New: Introducing PHP and Composer Support.Read the Announcement
Socket
Book a DemoInstallSign in
Socket

rte

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rte

Simple filepath re-writing for node.js projects. Useful for re-writing paths in grunt/gulp/assemble tasks or plugins.

Source
npmnpm
Version
2.0.0
Version published
Weekly downloads
8
-68%
Maintainers
1
Weekly downloads
 
Created
Source

rte NPM version

Simple filepath re-writing for node.js projects. Useful for re-writing paths in grunt/gulp/assemble tasks or plugins.

v2.0 released! Breaking changes!

  • .process() is now .stringify()

Install with npm

npm i rte --save

Usage

var rte = require('rte');

API

rte

Generate a file path from properties on the given object.

  • src {String}: Optionally pass a source file path to parse.
  • dest {String}: Template for the destination file path with :properties to replace.
  • data {Object}: Object with values to pass to the dest.

Examples:

rte(':a/:b:.c', { a: 'aaa', b: 'bbb', c: 'js' });
//=> 'aaa/bbb/c.js'

When a source file path is passed as the first argument, it will be parsed and the resulting object will merged with the data object (properties on the data object take precendence).

rte('a/b/c.html', ':destbase/:basename', { destbase: 'foo' });
//=> 'foo/c.html'

Running tests

Install dev dependencies.

npm i -d && npm test

Contributing

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

Author

Jon Schlinkert

License

Copyright (c) 2014-2015 Jon Schlinkert. Released under the license

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

Keywords

basename

FAQs

Package last updated on 23 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts