slugify-files
v2.1.0
Published
A simple CL tool to slugify files (kebab-case).
Downloads
14
Maintainers
Readme
slugify-files
A simple CL tool to slugify files (kebab-case)
"this Filename NEEDS cleaning.png" -> "this-filename-needs-cleaning.png"
CHANGELOG
INSTALL
$ npm install slugify-files
USAGE
var slugify = require('slugify-files');
slugify(['*.png'], function (err, sluggedFiles) {
sluggedFiles.forEach(function(file, idx)) {
console.log(file.old, 'renamed to', file.new);
}
});
CLI
$ npm install --global slugify-files
$ slugify --help
Usage
$ slugify <source>
Example
$ slugify '*.tmp'
<source> can contain globs if quoted
API
slugify(source, function(err, sluggedFiles){});
source
: globerr
: errorsluggedFiles
: Array of slugged files objects. Each has two keys:old
andnew
CONTRIBUTE
$ git clone [email protected]:raiseandfall/slugify-files.git && cd slugify-files
$ npm i
Run
$ npm run dev
Run tests
$ npm run test
LICENSE
MIT