Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
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
0.4.1
Version published
Maintainers
1
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.

Install

Install with npm

npm i rte --save

Run tests

npm test

Usage

var Rte = require('rte');

API

rte

Stringify a file path by replacing :properties in a template with values from the given context.

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

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 context object (properties on the context object take precendence).

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

Contributing

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

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license

This file was generated by verb-cli on October 28, 2014.

Keywords

blog

FAQs

Package last updated on 28 Oct 2014

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