
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
A module which allows you to require and try out npm modules directly without `npm install`-ing them. You can use this to quickly test out different modules in your project, inside a toy project or in the terminal.
A module which allows you to require and try out npm modules directly without npm install-ing them. You can use this to quickly test out different modules in your project, inside a toy project or in the terminal.
Modules are downloaded and prepared in a predefined directory(/tmp/ by default) and then required back to you. The modules are cached so only the first time a module is used it might take a little longer to load.
const lrequire = require('lrequire');
lrequire.configure({
path: '/tmp/lrequire' //where the modules will be downloaded
})
Basic:
const lrequire = require('lrequire');
const validUrl = lrequire('valid-url');
const latestVersion = lrequire('npmjs.org/package/latest-version');
Download specific version:
const lrequire = require('lrequire');
const validUrl = lrequire('valid-url', {
version: '1.0.8'
});
const latestVersion = lrequire('npmjs.org/package/latest-version', {
version: 'latest' //this is the default
});
You can also make lrequire global and use it at will. Later, if you wish to keep a package, you can remove the l and everything will continue working.
require('lrequire').global();
const validUrl = lrequire('valid-url');
const latestVersion = lrequire('npmjs.org/package/latest-version');
Make sure to install lrequire globally:
$ npm i -g lrequire
Execute lrequire in your terminal, the lrequire function will be available in the newly opened repl which means you can directly start requiring modules. You can also use the require function, it will try to require a module and fallback to lrequire.
$ lrequire
> const { markdown } = require('markdown');
> $ markdown.toHTML('Hello *World*!');
'<p>Hello <em>World</em>!</p>'
On linux consider using tmpfs. You can mount it on /tmp/lrequire or even /tmp which is a common practice. Don't forget that the directory where the files are saved can be configured.
On MacOS and Windows there are some RamDisk implementations that might work.
Node 8
Require a module synchronously.
Require a module asynchronously, the result can be awaited.
Require a module asynchronously, the result is passed as a second argument as per the node.js callback conventions.
Configure lrequire.
Add lrequire to global.
Get the config object
Get the cache which holds the latest version available in npm for each package installed during the application's lifetime.
FAQs
A module which allows you to require and try out npm modules directly without `npm install`-ing them. You can use this to quickly test out different modules in your project, inside a toy project or in the terminal.
The npm package lrequire receives a total of 8 weekly downloads. As such, lrequire popularity was classified as not popular.
We found that lrequire demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.