constipated
Advanced tools
Comparing version 1.0.1 to 1.0.2
22
index.js
@@ -0,10 +1,8 @@ | ||
var fs = require('fs'); | ||
var glob = require('glob'); | ||
var fs = require('fs'); | ||
module.exports = {relieveGlob, relieveFile, relieveString}; | ||
module.exports = {relieveFile, relieveGlob, relieveString}; | ||
function relieveGlob (pattern) { | ||
var files = glob.sync(pattern); | ||
files.forEach(relieveFile); | ||
function readFile(file) { | ||
return fs.readFileSync(file, 'utf8'); | ||
} | ||
@@ -18,2 +16,8 @@ | ||
function relieveGlob (pattern) { | ||
var files = glob.sync(pattern); | ||
files.forEach(relieveFile); | ||
} | ||
function relieveString (str) { | ||
@@ -23,8 +27,4 @@ return str.replace(/const(\s*[^\s]+\s*=\s*)/gmi, 'var$1'); | ||
function readFile(file) { | ||
return fs.readFileSync(file, 'utf8'); | ||
} | ||
function writeFile(file, contents) { | ||
return fs.writeFileSync(file, contents, 'utf8'); | ||
} | ||
} |
{ | ||
"name": "constipated", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Turns your consts in to vars, relieve those variables.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -18,8 +18,2 @@ # constipated | ||
### relieveString(str) : string | ||
``` javascript | ||
var {relieveString} = require('constipated'); | ||
var relievedString = relieveString('const constipated = true'); | ||
``` | ||
### relieveFile(file) : void | ||
@@ -37,2 +31,8 @@ ``` javascript | ||
### relieveString(str) : string | ||
``` javascript | ||
var {relieveString} = require('constipated'); | ||
var relievedString = relieveString('const constipated = true'); | ||
``` | ||
## License | ||
@@ -39,0 +39,0 @@ The MIT License |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
48661
439
0