Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
@swc/cli is a command-line interface for the SWC (Speedy Web Compiler) project, which is a super-fast TypeScript/JavaScript compiler written in Rust. It is designed to be a drop-in replacement for Babel, offering similar functionalities but with significantly improved performance.
Transpile JavaScript/TypeScript
This command transpiles a JavaScript or TypeScript file from 'input.js' to 'output.js'. SWC can handle modern JavaScript and TypeScript syntax and transform it into a format that is compatible with older environments.
swc input.js -o output.js
Watch Mode
This command runs SWC in watch mode, which means it will continuously watch the 'input.js' file for changes and recompile it to 'output.js' whenever a change is detected.
swc input.js -o output.js -w
Source Maps
This command generates source maps for the transpiled code, which can be very useful for debugging. The source maps help map the transpiled code back to the original source code.
swc input.js -o output.js --source-maps
Configuration File
This command allows you to specify a configuration file for SWC. The configuration file (.swcrc) can contain various options for customizing the behavior of the compiler.
swc -C path/to/.swcrc
Babel CLI is a command-line interface for Babel, a widely-used JavaScript compiler. Babel is known for its extensive plugin ecosystem and flexibility. However, it is generally slower than SWC because it is written in JavaScript rather than Rust.
esbuild is an extremely fast JavaScript bundler and minifier. Like SWC, it is written in a low-level language (Go) for performance. esbuild focuses on bundling and minification, whereas SWC focuses more on transpilation.
The TypeScript compiler (tsc) is the official compiler for TypeScript. It is highly integrated with the TypeScript language and offers extensive type-checking capabilities. While it is not as fast as SWC, it provides a comprehensive solution for TypeScript projects.
See our website swc-cli for more information or the issues associated with this package.
Beta version of @swc/cli is now available via `swcx command. This'll be a default command for @swc/cli@1. Please give it a try and report any issues at https://github.com/swc-project/swc/issues/4017
FAQs
CLI for the swc project
The npm package @swc/cli receives a total of 1,176,785 weekly downloads. As such, @swc/cli popularity was classified as popular.
We found that @swc/cli 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
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.