Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
better-require
Advanced tools
require('better-require')('json yaml') lets you load JSON and YAML files using require syntax. For example: var config = require('./config.json'); Extensions available are: json, yaml.
Augments require() with support for multiple file formats.
... which return a JSON representation:
... which return a Javascript module:
... work in progress:
Behind the scenes, this module adds handlers to require.extensions.
npm install better-require
/**
* @param {String} optional - formats is a white space separated list of formats you would like require() to support.
*/
// support all available extensions
require('better-require')();
// support a subset of extensions
require('better-require')(formats);
Enable support for all file types:
require('better-require')();
var config = require('./config.json');
console.log(config);
Enable support for only a subset of file types:
require('better-require')('json yaml xml');
// we can now require .xml, .yaml and .xml files!
var config = require('./config.yaml');
console.log(config);
FAQs
require('better-require')('json yaml') lets you load JSON and YAML files using require syntax. For example: var config = require('./config.json'); Extensions available are: json, yaml.
The npm package better-require receives a total of 25 weekly downloads. As such, better-require popularity was classified as not popular.
We found that better-require 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
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.