replace-requires
Replace require statements
Last updated 7 years ago by bendrucker .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install replace-requires 
SYNC missed versions from official npm registry.

replace-requires Build Status

Replace require statements

Install

$ npm install --save replace-requires

Usage

var replaceRequires = require('replace-requires');

replaceRequires('require("foo")', {foo: 'bar'});
//=> bar

API

replaceRequires(code, replacements) -> string

code

Required
Type: string

The code to parse and replace.

replacements

Required
Type: object

The replacements, where keys are module ids and the corresponding values are the replacements for their require statements.

License

MIT © Ben Drucker

Current Tags

  • 1.1.0                                ...           latest (7 years ago)

6 Versions

  • 1.1.0                                ...           7 years ago
  • 1.0.4                                ...           8 years ago
  • 1.0.3                                ...           9 years ago
  • 1.0.2                                ...           9 years ago
  • 1.0.1                                ...           9 years ago
  • 1.0.0                                ...           9 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (2)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |