Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
lz-node-utils
Advanced tools
Useful utility functions for node.
npm install --save-dev git+http://git@github.com/lzilioli/lz-node-utils.git
var util = require( 'lz-node-utils' );
util.file
The following were taken from grunt.file
, with the grunt dependency removed.
file.expand
file.expandMapping
file.read
file.exists
file.readJSON
file.readYAML
file.mkdir
util.reqfn(rootDir)
Returns a function that, when called, will require a module relative to rootDir
.
// Returned Function
/**
* Requires a file from the relative root passed to the function's generator.
*
* @param {String} pathToModule relative path to module from rootDir passed to generator
* @param {Bool} fromRoot (optional) if passed, the rootDir will be
* ignored. This is a convenient way to load
* a module relative to your project's root.
* @return {Object} result of calling
* require([rootDir/]pathToModule)
*/
util.pth
Like path.join, but returns an absolute path to the referenced location.
util.pth('grunt/config/file.json'); // returns /path/to/repo/grunt/config/file.json
util.pth('grunt', 'config', 'file.json'); // also returns /path/to/repo/grunt/config/file.json
util.pth('grunt/', '/config', '//', '/file.json'); // also returns /path/to/repo/grunt/config/file.json
util.loadAppSettings(<defaultSettingsPath>, <userSettingsPath>)
Function that returns a configuration given a path to a file in which defaults are specified, and a path to a file in which user overrides are specified. Resulting object is defaultSettings object with userSettings object overriding.
Arguments default to config/default-settings.js
and config/settings.js
, respectively.
util.stripYamlFront(fileContents)
Given the contents of a file, return its contents without the YAML front matter.
util.reqFn
, util.pth
, and util.loadAppSettings
util.stripYamlFront
FAQs
Useful utility functions for node.
We found that lz-node-utils 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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.