Skip to content

mike-spainhower/ls-fs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ls-fs Build Status

File utils

Snuffles

Usage

var lsFs = require('ls-fs');

lsFs.readJson('settings.json').then(function(settings) {
    console.log(settings.prop1);
    console.log(settings.prop2);
});

API

readJson

lsFs.readJson(path, [opts]).then(function(parsedJsonObj) {
    console.log(parsedJsonObj);
});
Arguments
  1. path (String) The path to the JSON file to read

writeJson

lsFs.writeJson(path, obj, [opts]).then(function(pathToJson) {
    
});
Arguments
  1. path (String) The path to the JSON file to write
  2. obj (*) The thing to JSON.stringify

tmpDir

lsFs.tmpDir([opts]).then(function(pathToTmpDir) {
    // do stuff with my temporary directory
});
Arguments
  1. [opts] (Object) Same as https://github.com/raszi/node-tmp#directory-creation

About

Filesystem utils

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%