
Research
/Security News
Popular Tinycolor npm Package Compromised in Supply Chain Attack Affecting 40+ Packages
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
require-compiled
Advanced tools
require-compiled
works just like regular require
, except it allows you to require code written in newer versions of JS.
Just add a .babelrc file to your project and you're good to go!
// Read babel options our of your .babelrc:
var requireCompiled = require('require-compiled');
var myModule = requireCompiled('./my-module');
var myModulePath = requireCompiled.resolve('./my-module');
// Instead of using a .babelrc, you can also pass in your babel options explicitly:
var requireCompiled = require('require-compiled').babelOptions({ ... });
Only the module directly required this way gets compiled.
To compile some of its dependencies as well, mark them with a compile!
flag:
var myChildModule = require('compile!./child')
Behind the scenes the the modules required this way are compiled into a cache directory.
Because of this, require-compiled
does not need to load require hooks into your node process.
require-compiled
does load node-source-map-support to give you nice stack traces in your errors.
The code of the amazing ava testrunner was a great inspiration and guide for this module.
FAQs
The easiest way to require babel-compiled modules.
We found that require-compiled 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.
Research
/Security News
Malicious update to @ctrl/tinycolor on npm is part of a supply-chain attack hitting 40+ packages across maintainers
Security News
pnpm's new minimumReleaseAge setting delays package updates to prevent supply chain attacks, with other tools like Taze and NCU following suit.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.