1. require-from-string
Require module from string
require-from-string
Package: require-from-string
Created by: floatdrop
Last modified: Sun, 26 Jun 2022 11:37:26 GMT
Version: 2.0.2
License: MIT
Downloads: 118,304,820
Repository: https://github.com/floatdrop/require-from-string

Install

npm install require-from-string
yarn add require-from-string

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

Dependencies

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin