Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Readme
Install:
npm install --save mkenv
Use:
var mkenv = require('mkenv');
constructor: mkenv(envs...) accepts hashes
mkenv({ x: 'y' })('x').should.equal('y')
constructor: mkenv(envs...) accepts functions
mkenv(function (name) {
return name == 'x' ? 'y' : null;
})('x').should.equal('y')
composition allows values to be retrieved from the root
mkenv(
{ z: 'y' },
mkenv({ 'x': '$z' })
)('x').should.equal('y')
value retrieval works by calling the env with a key
mkenv({ x: 'y' })('x').should.equal('y')
value retrieval gives the rightmost value (overriding)
mkenv({ x: 'y' }, { x: 'z'})('x').should.equal('z')
value retrieval returns null on an unknown key
should.equal(
mkenv({ x: 'y' })('z'), null
)
simple replacements can be made
mkenv({
x: 'y',
y: '$x'
})('y').should.equal('y')
simple replacements can be combined
mkenv({
x: 'y',
y: '$x$x$x'
})('y').should.equal('yyy')
simple replacements can be chained
mkenv({
x: 'y',
y: '$x',
z: '$y',
w: '$z'
})('w').should.equal('y')
bracketed replacements can be made
mkenv({
x: 'y',
y: '${x}'
})('y').should.equal('y')
bracketed replacements can be nested
mkenv({
x: 'y',
n: 'x',
y: '${$n}'
})('y').should.equal('y')
bracketed replacements can be nested, combined, and chained
mkenv({
x: 'y',
n: 'x',
xx: '$x$x',
y: '${$n$n}'
})('y').should.equal('yy')
mkenv.keys(env) returns the keys stored in an env
mkenv.keys(
mkenv({ x: 'y' }, { y: 'z'})
).should.eql(['x', 'y'])
mkenv.keys(env) returns the keys stored in a nested env
mkenv.keys(
mkenv({ x: 'y' }, mkenv({ y: 'z'}))
).should.eql(['x', 'y'])
mkenv.keys(env) returns additional keys
var env = mkenv({ x: 'y' });
env.y = 'z'
mkenv.keys(env).should.eql(['x', 'y'])
mkenv.vars(env) returns the vars stored in an env
mkenv.vars(
mkenv({ x: 'y' }, { y: 'z'})
).should.eql({ x: 'y', y: 'z'})
mkenv.vars(env) returns the vars stored in a nested env
mkenv.vars(
mkenv({ x: 'y' }, mkenv({ y: 'z'}))
).should.eql({ x: 'y', y: 'z'})
mkenv.vars(env) returns additional keys
var env = mkenv({ x: 'y' });
env.y = 'z'
mkenv.vars(env).should.eql({ x: 'y', y: 'z'})
mkenv.hidden(env) allows values to be retrieved from the root
mkenv(
mkenv.hidden({ z: 'y' }),
mkenv({ 'x': '$z' })
)('x').should.equal('y')
mkenv.hidden(env) doesn't allow direct retrieval from the root
should.equal(
mkenv(
mkenv.hidden({ z: 'y' }),
mkenv({ 'x': '${z}' })
)('z'),
null
)
Documentation generated by Docha
FAQs
Parser/template engine for simple enviroment variable-like text replacements
The npm package mkenv receives a total of 0 weekly downloads. As such, mkenv popularity was classified as not popular.
We found that mkenv 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
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.