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.
@swc/core-linux-x64-musl
Advanced tools
The @swc/core-linux-x64-musl package is a precompiled version of SWC (Speedy Web Compiler) specifically for Linux x64 systems using the musl libc. SWC is a super-fast compiler written in Rust that allows for transforming ECMAScript 2015+ code into a backward-compatible version of JavaScript that can be run in older browsers. It's also capable of handling JSX, TypeScript, and producing source maps.
JavaScript/TypeScript Compilation
This feature allows for the compilation of modern JavaScript or TypeScript code into a version compatible with older browsers. The code sample demonstrates how to synchronously compile a simple ES6 const declaration into ES5.
require('@swc/core-linux-x64-musl').transformSync('const x = 1;', { jsc: { target: 'es5' } });
JSX Transformation
This feature enables the transformation of JSX syntax into JavaScript, making it possible to use React or similar libraries. The code sample shows how to transform a simple JSX element into JavaScript.
require('@swc/core-linux-x64-musl').transformSync('<div>Hello, world!</div>', { jsc: { parser: { syntax: 'typescript', tsx: true }, target: 'es5' }, filename: 'file.tsx' });
Source Map Generation
This feature generates source maps for the transformed code, facilitating debugging by mapping the transformed code back to the original source code. The code sample demonstrates generating a source map for a simple piece of code.
require('@swc/core-linux-x64-musl').transformSync('const x = 1;', { sourceMaps: true });
Babel is a widely used JavaScript compiler that also allows for transforming modern JavaScript into backward-compatible versions. Compared to @swc/core-linux-x64-musl, Babel is more established but generally slower because it is written in JavaScript.
The TypeScript compiler can convert TypeScript code into JavaScript, including handling JSX and generating source maps. While it offers similar functionality for TypeScript, it does not focus on the same performance optimization as SWC.
Esbuild is a super-fast JavaScript bundler and minifier that also compiles TypeScript and JSX. It is similar to SWC in terms of speed and efficiency because it is also written in a compiled language (Go), making it a strong alternative for certain use cases.
@swc/core-linux-x64-musl
This is the x86_64-unknown-linux-musl binary for @swc/core
[1.9.3] - 2024-11-22
(@swc/types) Tsc build file ignored by npm (#9754) (14a5c1e)
(es) Source map super(...args)
calls in injected constructors (#9745) (35b0ca0)
(es/plugin) Migrate swc plugin new
to use .cargo/config.toml
(#9740) (4ffb21e)
(es/resolver) Ignore VarDecl
with declare: true
(#9734) (aa0f784)
FAQs
Super-fast alternative for babel
The npm package @swc/core-linux-x64-musl receives a total of 6,183,364 weekly downloads. As such, @swc/core-linux-x64-musl popularity was classified as popular.
We found that @swc/core-linux-x64-musl demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.