Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
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
util.ucwords
FAQs
Useful utility functions for node.
The npm package lz-node-utils receives a total of 5 weekly downloads. As such, lz-node-utils popularity was classified as not popular.
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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.