Comparing version 1.0.13 to 1.0.14
{ | ||
"name": "yow", | ||
"version": "1.0.13", | ||
"version": "1.0.14", | ||
"description": "You Only Wish module", | ||
@@ -5,0 +5,0 @@ "main": "yow.js", |
@@ -19,5 +19,7 @@ # Yow | ||
- **mkdir(path)** - Creates the directory you specify. | ||
- **mkpath(path)** - Creates the directory you specify. It will create multiple directories if they do not exit. | ||
- **fileExists(path)** - Nothing fancy, it just returns true/false. | ||
- **mkdir(path)** - Creates the directory you specify. | ||
- **mkpath(path)** - Creates the directory you specify. It will create multiple directories if they do not exit. | ||
- **fileExists(path)** - Nothing fancy, it just returns true/false. | ||
- **readJSON(fileName)** - Reads a JSON file and returns the contents. | ||
- **writeJSON(fileName, object)** - Writes an object to a JSON file. | ||
@@ -24,0 +26,0 @@ |
var fs = require('fs'); | ||
var Path = require('path'); | ||
var readJSON = module.exports.readJSON = function(fileName, defaultValue) { | ||
return JSON.parse(fs.readFileSync(fileName)); | ||
} | ||
var writeJSON = module.exports.writeJSON = function(fileName, object) { | ||
return fs.writeFileSync(fileName, JSON.stringify(object, null, '\t')); | ||
} | ||
var fileExists = module.exports.fileExists = function(path) { | ||
@@ -5,0 +13,0 @@ |
var random = require('./yow.js').random; | ||
var fileExists = require('./yow.js').fileExists; | ||
var writeJSON = require('./yow.js').writeJSON; | ||
var readJSON = require('./yow.js').readJSON; | ||
@@ -8,1 +11,4 @@ console.log(random({A:'Ahh', B:'Bee', C:'See'})); | ||
console.log(random('Foo')); | ||
console.log(fileExists('test.js')); | ||
console.log(writeJSON('a.json', {a:1})); | ||
console.log(readJSON('a.json')); |
@@ -24,2 +24,4 @@ module.exports.sprintf = require('sprintf-js').sprintf; | ||
module.exports.fileExists = require('./src/fs.js').fileExists; | ||
module.exports.readJSON = require('./src/fs.js').readJSON; | ||
module.exports.writeJSON = require('./src/fs.js').writeJSON; | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12221
300
46