biofriction-wp-theme/node_modules/rewrite-ext
jorge a7910c81a8 moved to new repo 2021-10-26 14:18:09 +02:00
..
LICENSE moved to new repo 2021-10-26 14:18:09 +02:00
README.md moved to new repo 2021-10-26 14:18:09 +02:00
index.js moved to new repo 2021-10-26 14:18:09 +02:00
package.json moved to new repo 2021-10-26 14:18:09 +02:00

README.md

rewrite-ext NPM version

Automatically re-write the destination extension of a filepath based on the source extension. e.g .coffee => .js. This will only rename the ext, no other path parts are modified.

Install with npm

npm i rewrite-ext --save

Running tests

Install dev dependencies.

npm i -d && npm test

Usage

var rewrite = require('rewrite-ext');
rewrite('abc.coffee');
//=> 'abc.js'
rewrite('abc.less');
//=> 'abc.css'

Explicitly pass an extension to use:

rewrite('./faux.js', '.foo');
//=> 'faux.foo'

More examples

rewrite('abc.styl');
//=> 'abc.css'
rewrite('abc.sass');
//=> 'abc.css'
rewrite('abc.scss');
//=> 'abc.css'
rewrite('abc.swig');
//=> 'abc.html'
rewrite('abc.hbs');
//=> 'abc.html'
rewrite('abc.md');
//=> 'abc.html'
rewrite('abc.tmpl');
//=> 'abc.html'
rewrite('./faux.js', '.bar');
//=> 'faux.bar'
rewrite('faux.js');
//=> 'faux.js'
rewrite('faux.css');
//=> 'faux.css'
rewrite('faux.html');
//=> 'faux.html'

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright (c) 2015 Jon Schlinkert
Released under the license


This file was generated by verb on February 22, 2015.