Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
@figma/esbuild-runner
Advanced tools
Super-fast on-the-fly transpilation of modern JS, TypeScript and JSX using esbuild
esr
)Super-fast on-the-fly transpilation of modern JS, TypeScript and JSX using esbuild.
esr makes it easy to run arbitrary code or tests without needing to build your whole project. It's a great way to improve your development workflow.
The easiest way to use esbuild-runner is to install it globally and use the included esr
binary.
$ esr hello-world.ts
Alternatively, you can require esbuild-runner within any nodejs process to include realtime transpilation:
$ node -r esbuild-runner/register hello-world.ts
In order to use esbuild-runner with Jest, you need to configure a Jest transform in your jest.config.js
module.exports = {
transform: {
"\\.ts$": "esbuild-runner/jest",
},
}
VSCode Debugging
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug with esbuild-runner",
"program": "${workspaceFolder}/hello-world.ts",
"runtimeArgs": [
"-r",
"esbuild-runner/register"
],
"request": "launch",
"sourceMaps": true,
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node"
}
]
}
esr
provides two different ways to transpile your code:
package.json
or node_modules
will never be transpiled. Running esr
will always transpile the code. No caching is used.--cache
): this method will invoke esbuild for every source file, but will cache the result. This means that the initial run will be slower, but after that, only changed source files will be transpiled.$ bin/esr.js --help
Usage: esr [options] <source-file> [file-options]
--cache Transform on a file per file basis and cache code
--clearCache Clear transform cache
--help|-h Display this help message
To customize the options passed to esbuild, you can create an esbuild-runner.config.js
file in the current directory or one of the ancestor directories.
// example esbuild-runner.config.js
module.exports = {
type: "bundle", // bundle or transform (see description above)
esbuild: {
// Any esbuild build or transform options go here
target: "esnext",
},
}
Simply install the esbuild-runner npm package using your favorite package manager.
$ npm install -g esbuild-runner
$ npm add --dev esbuild-runner
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
FAQs
Super-fast on-the-fly transpilation of modern JS, TypeScript and JSX using esbuild
The npm package @figma/esbuild-runner receives a total of 54 weekly downloads. As such, @figma/esbuild-runner popularity was classified as not popular.
We found that @figma/esbuild-runner demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 26 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.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.