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.
ES7 support for Acorn. It works with node.js and plain browser:
** decorators: ** works with acorn and acorn loose parser. ** provides a walk ** async/await ** see acorn-es7-plugin
See sample.js:
// Require acorn as usual
var acorn = require("acorn");
// Add the es7-plugin
require('./acorn-es7')(acorn) ;
var code = "@Component()\n class AppComponent{}";
var ast = acorn.parse(code,{
// Specify use of the plugin
plugins:{es7:true},
// Specify the ecmaVersion
ecmaVersion:7
}) ;
// Show the AST
console.log(JSON.stringify(ast, null, 1)) ;
@Component()
class AppComponent{}
{
"type": "Program",
"start": 0,
"end": 34,
"body": [
{
"type": "ClassDeclaration",
"start": 0,
"end": 34,
"id": {
"type": "Identifier",
"start": 20,
"end": 32,
"name": "AppComponent"
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 32,
"end": 34,
"body": []
},
"decorators": [
{
"type": "Decorator",
"start": 0,
"end": 12,
"expression": {
"type": "CallExpression",
"start": 1,
"end": 12,
"callee": {
"type": "Identifier",
"start": 1,
"end": 10,
"name": "Component"
},
"arguments": []
}
}
]
}
],
"sourceType": "script"
}
FAQs
ES7 decorators support for Acorn.
The npm package acorn-es7 receives a total of 2,748 weekly downloads. As such, acorn-es7 popularity was classified as popular.
We found that acorn-es7 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’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.