
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
monadic.js-playground
Advanced tools
Here you can play with Haskell-like do notation language extension
To install package from npm type:
npm install monadic.js-playground
To build type into root dir:
npm install
webpack
To run type into root dir:
node build/monadic.dev.js
# or (depend on NODE_ENV value during build stage)
node build/monadic.min.js
If you wanna change something, entry point is here: index.js
Enjoy ;)
How it looks like:
const unit = {};
const log = msg => console.log(msg);
const curry2 = fn => a => b => fn(a, b);
const fetch = curry2((url, cb) => setTimeout(cb, 100, url));
const apply = (fn, arg) => fn(arg);
const listMonad = apply(() => {
const mreturn = a => [a];
const mbind = (mval, fn) => mval
.map(val => fn(val))
.reduce((prev, next) => prev.concat(next), []);
// MonadPlus
const mzero = [];
const mplus = (a, b) => a.concat(b);
const guard = p => p ? mreturn(unit) : mzero;
return {
mreturn,
mbind,
mzero,
mplus,
guard
};
}, null);
const contMonad = {
mreturn: a => fn => fn(a),
mbind: (mval, fn) => c => mval(val => fn(val)(c))
};
const demoList = do listMonad {
a <- [1, 2, 3];
b <- do listMonad {
c <- [1, 2, 3];
d <- [1, 2, 3];
return c + d;
};
listMonad.guard(a + b > 7);
return a + b;
};
const demoCont = do contMonad {
data <- fetch("data");
moreData <- fetch("data_data");
evenMoreData <- fetch(moreData + "_data_data");
return { data, moreData, evenMoreData };
};
// DEMO:
log(demoList);
demoCont(log);
FAQs
Here you can play with Haskell-like do notation language extension
We found that monadic.js-playground 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 how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.