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                                ...           3 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           5 years ago
  • 2.0.1                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 3,124
This Week 57,173
This Month 224,256
Last Day 4,104
Last Week 56,616
Last Month 185,554
Dependencies (0)
None
Dev Dependencies (1)
Dependents (363)

Copyright 2014 - 2016 © taobao.org |