require-from-string
npmv2.0.2Require module from string
Not recommended for new projects
No — require-from-string should not be adopted for new projects. Last published 3075 days ago.
- AAdoption: grade A, Excellent.
120.1M downloads per week and 3 known dependents.
- FMaintenance: grade F, Failing.
Last published 3075 days ago.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 3.3 KB installed.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding require-from-string to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Compatibility
- Node.js
- node >=0.10.0
- Module format
- CommonJS only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the require-from-string README.
var requireFromString = require('require-from-string');
requireFromString('module.exports = 1');
//=> 1Dependencies
Declared by require-from-string v2.0.2. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (1)
Used by
Popular packages that depend on require-from-string.
A JavaScript implementation of the Unicode Bidirectional Algorithm
Build and manage the AJV instances for the fastify framework
A library to generate a fingerprint from a React Native project
Relationship graph
Dependencies (left) and dependents (right) of require-from-string.
Frequently installed together
TypeScript definitions for debug
Unopinionated, no-frills CLI argument parser
Get and typecast environment variables.
A Promise-based interface into processes created by child_process.spawn
hydrate environment variables from .env files into process.env
Lightweight debugging utility for Node.js and the browser
The semantic version parser used by npm.
a glob matcher in javascript
TypeScript definitions for node
the most correct and second fastest glob implementation in JavaScript
The Expo SDK
Resolve the path of a module like `require.resolve()` but from a given path
Release history
No releases in the last two years, typically about 151 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 2.0.2latest | 8 years ago | 3.3 KB | MIT |
| 2.0.1 | 9 years ago | — | MIT |
| 2.0.0 | 9 years ago | — | MIT |
| 1.2.1 | 10 years ago | — | MIT |
| 1.2.0 | 10 years ago | — | MIT |
| 1.1.0 | 10 years ago | — | MIT |
| 1.0.2 | 11 years ago | — | MIT |
| 1.0.1 | 11 years ago | — | MIT |
| 1.0.0 | 11 years ago | — | MIT |
Overview
require-from-string is an npm package that require module from string. It is extremely widely used, with about 120.1M downloads per week and 3 known dependents in the graph. The latest version is 2.0.2, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need require module from string and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (120.1M weekly downloads).
- Clear open-source license (MIT).
- Lean dependency tree (1 direct dependencies).
Cons
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use require-from-string?
No — require-from-string should not be adopted for new projects. Last published 3075 days ago.
How do I install require-from-string?
Run `npm install require-from-string` to add require-from-string to your npm project.
What license is require-from-string released under?
require-from-string is distributed under the MIT license.
How popular is require-from-string?
require-from-string has approximately 120,058,757 downloads per week and 3 known dependent packages.
Is require-from-string still maintained?
The most recent release of require-from-string (v2.0.2) was published 8 years ago.
Does require-from-string run install scripts?
No. require-from-string does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.