
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
functional_utils
Advanced tools
Functional programming utils
This lib provides some utility functions that can be useful while writing code in node.js Basic test for usage of this module.
const Utils = require('@nodeart/functional_utils'),
assert = require('assert');
//curry test
const curried = Utils.curry((...args) => args.length, 0, 1, 2, 3, 4);
assert.equal(curried(5, 6, 7, 8, 9), 10, 'Curry test done');
//pipe test
const piped = Utils.pipe(d => d * 2, d => d * 3, d => d * 4, d => d * 5);
assert.equal(piped(2), 240, 'Pipe test done');
//asyncPipe test
const asyncPiped = Utils.asyncPipe(
res => assert.equal(res, 240, 'AsyncPipe test done'),
(d, cb) => setTimeout(() => cb(d * 2), 500),
(d, cb) => setTimeout(() => cb(d * 3), 500),
(d, cb) => setTimeout(() => cb(d * 4), 500),
(d, cb) => setTimeout(() => cb(d * 5), 500)
);
asyncPiped(2);
//compose test
const composed = Utils.compose(d => d / 5, d => d / 4, d => d / 3, d => d / 2);
assert.equal(composed(240), 2, 'Compose test done');
//asyncCompose test
const asyncComposed = Utils.asyncCompose(
res => assert.equal(res, 2, 'AsyncComposed test done'),
(d, cb) => setTimeout(() => cb(d / 5), 500),
(d, cb) => setTimeout(() => cb(d / 4), 500),
(d, cb) => setTimeout(() => cb(d / 3), 500),
(d, cb) => setTimeout(() => cb(d / 2), 500)
);
asyncComposed(240);
FAQs
Set of useful functions to fester development
The npm package functional_utils receives a total of 2 weekly downloads. As such, functional_utils popularity was classified as not popular.
We found that functional_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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.