Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
run any exported object directly from the CLI
$ npm i -g clize
$ clize ~/Desktop/foo.js 123 \'hello\' # ...
Let's say we have a foo.js
file in ~/Desktop/foo.js
. This file looks like this :
module.exports = (a, b) => {
return a + b
}
This is great and all, we require it in out other files and use the return value. However I often find myself in need of a module that can be required, but also that can be executed directly from the CLI and still work.
Now with clize you can directly call such modules. Here is how it looks like :
$ clize ~/Desktop/foo.js 1 2
3
That's it.
You can pass either :
../../foo/bar.js
)/Users/user/foo/bar.js
)By default, only the default export is required and executed.
If you use named export, you can specificy the -m
(module) option along with the module name.
$ clize ~/Desktop/foo.js -m coolModule 1 2
Where foo.js
contains exports.coolModule = ...
You can pass as many arguments as you wish to your module. To keep the code clean and the CLI easy to use, you will need to escape variable delimitation characters. What this means :
integer
-> 4
-> no delimitation, simply write 4
string
-> 'hello'
-> has ' as delimitation, your shell will strip these characters if not escaped, so write \'foo\'
Same goes for any variable delimitation character that might be messed with by your shell.$ clize ~/Desktop/foo.js 1 2
3
$ clize ~/Desktop/foo.js 1 \'2\' # js auto ineference
12
$ clize ~/Desktop/foo.js \'1\' \'2\'
12
To be completed later, it's very easy, watch in index.ts
there's only like 20 lines of code.
FAQs
Unknown package
The npm package clize receives a total of 1 weekly downloads. As such, clize popularity was classified as not popular.
We found that clize demonstrated a healthy version release cadence and project activity because the last version was released less than 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.