![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
utile
Advanced tools
Readme
A drop-in replacement for util
with some additional advantageous functions
Javascript is definitely a "batteries not included language" when compared to languages like Ruby or Python. Node.js has a simple utility library which exposes some basic (but important) functionality:
$ node
> var util = require('util');
> util.
(...)
util.debug util.error util.exec util.inherits util.inspect
util.log util.p util.print util.pump util.puts
When one considers their own utility library, why ever bother requiring util
again? That is the approach taken by this module. To compare:
$ node
> var utile = require('./lib')
> utile.
(...)
utile.async utile.capitalize utile.clone utile.cpr utile.createPath utile.debug
utile.each utile.error utile.exec utile.file utile.filter utile.find
utile.inherits utile.log utile.mixin utile.mkdirp utile.p utile.path
utile.print utile.pump utile.puts utile.randomString utile.requireDir uile.requireDirLazy
utile.rimraf
As you can see all of the original methods from util
are there, but there are several new methods specific to utile
. A note about implementation: no node.js native modules are modified by utile, it simply copies those methods.
The utile
modules exposes some simple utility methods:
.each(obj, iterator)
: Iterate over the keys of an object..mixin(target [source0, source1, ...])
: Copies enumerable properties from source0 ... sourceN
onto target
and returns the resulting object..clone(obj)
: Shallow clones the specified object..capitalize(str)
: Capitalizes the specified str
..randomString(length)
: randomString returns a pseudo-random ASCII string (subset) the return value is a string of length ⌈bits/6⌉ of characters from the base64 alphabet..filter(obj, test)
: return an object with the properties that test
returns true on..args(arguments)
: Converts function arguments into actual array with special callback
, cb
, array
, and last
properties. Also supports optional argument contracts. See the example for more details..requireDir(directory)
: Requires all files and directories from directory
, returning an object with keys being filenames (without trailing .js
) and respective values being return values of require(filename)
..requireDirLazy(directoy)
: Lazily requires all files and directories from directory
, returning an object with keys being filenames (without trailing .js
) and respective values (getters) being return values of require(filename)
.In addition to the methods that are built-in, utile includes a number of commonly used dependencies to reduce the number of includes in your package.json. These modules are not eagerly loaded to be respectful of startup time, but instead are lazy-loaded getters on the utile
object
.async
: Async utilities for node and the browser.inflect
: Customizable inflections for node.js.mkdirp
: Recursively mkdir, like mkdir -p, but in node.js.rimraf
: A rm -rf util for nodejs.cpr
: Asynchronous recursive file copying with Node.js curl http://npmjs.org/install.sh | sh
[sudo] npm install utile
All tests are written with vows and should be run with npm:
$ npm test
FAQs
A drop-in replacement for `util` with some additional advantageous functions
The npm package utile receives a total of 270,954 weekly downloads. As such, utile popularity was classified as popular.
We found that utile demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.