require-from-string
Require module from string
Last updated 2 years ago by floatdrop .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install require-from-string 
SYNC missed versions from official npm registry.

require-from-string Build Status

Load module from string in Node.

Install

$ npm install --save require-from-string

Usage

var requireFromString = require('require-from-string');

requireFromString('module.exports = 1');
//=> 1

API

requireFromString(code, [filename], [options])

code

Required
Type: string

Module code.

filename

Type: string
Default: ''

Optional filename.

options

Type: object

appendPaths

Type: Array

List of paths, that will be appended to module paths. Useful, when you want to be able require modules from these paths.

prependPaths

Type: Array

Same as appendPaths, but paths will be prepended.

License

MIT © Vsevolod Strukchinsky

Current Tags

  • 2.0.2                                ...           latest (2 years ago)

9 Versions

  • 2.0.2                                ...           2 years ago
  • 1.2.1                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 2.0.1                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 7,452
This Week 27,373
This Month 117,209
Last Day 10,346
Last Week 55,714
Last Month 228,636
Dependencies (0)
None
Dev Dependencies (1)
Dependents (399)

Copyright 2014 - 2016 © taobao.org |