slugify-files

A simple CL tool to slugify files (kebab-case).

Usage no npm install needed!

<script type="module">
  import slugifyFiles from 'https://cdn.skypack.dev/slugify-files';
</script>

README

slugify-files

Build Status

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: glob
  • err: error
  • sluggedFiles: Array of slugged files objects. Each has two keys: old and new

CONTRIBUTE

$ git clone git@github.com:raiseandfall/slugify-files.git && cd slugify-files
$ npm i

Run

$ npm run dev

Run tests

$ npm run test

LICENSE

MIT