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.
@childrentime/js-interpreter
Advanced tools
This project is about to implement a simple javascript parser and visualize the ast
This project is my graduation project, the main purpose is to implement a simple javascript interpreter.
But maybe it's a good example for you to learn how to write a javascript interpreter because I try to finish it with minimal code.
If you want to add new syntax support, in general, you need to add parsing of the syntax expression in parse, and then interpret it in interperter.
In addition, the interperter of the while statement and for statement in the project is a bit rough.
This project uses node and npm. Go check them out if you don't have them locally installed.
npm i @childrentime/js-interpreter
import { interpreter } from "@childrentime/js-interpreter";
const result = interpreter(`var a = 1; console.log(a)`);
console.log(result); // [[1]]
The output of each console statement will be contained in an array so the result is a two-dimensional array
You can experience it in real time here.
Alternatively, you can view its test files here.
export { tokenizer, parse, interpreter };
const code = 'var a = 1;';
const tokens: { type: string, value: string | number }[] = tokenizer(code);
const ast = parse(code);
const interpreter: any[][] = interpreter(code);
MIT © ChildrenTime
FAQs
This project is about to implement a simple javascript parser and visualize the ast
The npm package @childrentime/js-interpreter receives a total of 2 weekly downloads. As such, @childrentime/js-interpreter popularity was classified as not popular.
We found that @childrentime/js-interpreter 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.