
Research
Malicious Go “crypto” Module Steals Passwords and Deploys Rekoobe Backdoor
An impersonated golang.org/x/crypto clone exfiltrates passwords, executes a remote shell stager, and delivers a Rekoobe backdoor on Linux.
babel-plugin-ceval
Advanced tools
This plugin allows Babel to execute ceval functions at compile time. It can be used for any kind
of code generations that needs to happen at build time. Instead of writing complicated build scripts, you can write
those code generation logics right inside your code.
npm install --save-dev babel-plugin-ceval
.babelrc
{
"plugins": ["ceval"]
}
babel --plugins ceval script.js
ceval(expression: string)Return value is used as is, it cannot return code fragments.
ceval(fn: function([args..])[, args..])If it returns a string, it is expected to be a code fragment. If you need to return a string value, simply enclose it with quotations (If string contains quotations, use JSON.stringify).
// In:
var envPath = ceval('process.env.PATH');
// Out:
var envPath = '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games';
// In:
var dirname = ceval('__dirname');
var filename= ceval('__filename');
// Out:
var dirname = '/home/arash16/Projects/ceval-test';
var filename = '/home/arash16/Projects/ceval-test/test.js';
// In:
var version = ceval('require("./package.json").version');
// Out:
var version = '1.0.0';
// In:
ceval(function() {
var r = '';
for (var i=0; i<4; ++i)
r += 'console.log('+i+');';
return r;
});
// Out:
console.log(0);console.log(1);console.log(2);console.log(3);
// In:
var code = ceval(function() {
var r = '';
for (var i=0; i<3; ++i)
r += 'console.log('+i+');';
return JSON.stringify(r);
});
// Out:
var code = 'console.log(0);console.log(1);console.log(2);';
// In:
ceval(function() {
if (process.env.SERVER)
return function checker(x) {
return x>2;
};
return function checker(x) {
return x>0;
};
});
// Out:
function checker(x) {
return x > 0;
}
// In:
const X = 1, Y = 2;
ceval(function(a, b) {
return 'console.log(' + (a+b) + ');';
}, X, Y);
// Out:
const X = 1,
Y = 2;
console.log(3);
// In:
var obj = ceval(function() {
return {
regex: /abc/g,
str: 'asdas',
arr: [1,2, { x: 1}],
fn: function (a, b) {
return a + b;
}
};
});
// Out:
var obj = {
'regex': /abc/g,
'str': 'asdas',
'arr': [1, 2, {
'x': 1
}],
'fn': function (a, b) {
return a + b;
}
};
If you need to return a promise, make sure to install deasync too.
npm install --save-dev deasync
// In:
ceval(function() {
return Promise
.resolve('read from database')
.then(x => `function dyna() {
return ${JSON.stringify(x.split(' '))};
}`);
});
// Out:
function dyna() {
return ["read", "from", "database"];
}
FAQs
a babel pluging for compile time evaluation.
The npm package babel-plugin-ceval receives a total of 3 weekly downloads. As such, babel-plugin-ceval popularity was classified as not popular.
We found that babel-plugin-ceval 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
An impersonated golang.org/x/crypto clone exfiltrates passwords, executes a remote shell stager, and delivers a Rekoobe backdoor on Linux.

Security News
npm rolls out a package release cooldown and scalable trusted publishing updates as ecosystem adoption of install safeguards grows.

Security News
AI agents are writing more code than ever, and that's creating new supply chain risks. Feross joins the Risky Business Podcast to break down what that means for open source security.