⚡️ Super-fast on-the-fly transpilation of modern JS, TypeScript and JSX using esbuild
Installations
npm install esbuild-runner
Score
52.4
Supply Chain
89.5
Quality
75.7
Maintenance
100
Vulnerability
99.3
License
Developer
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
Yes
Node Version
18.9.1
NPM Version
8.19.1
Statistics
715 Stars
63 Commits
24 Forks
3 Watching
11 Branches
5 Contributors
Updated on 28 Nov 2024
Bundle Size
45.37 kB
Minified
14.04 kB
Minified + Gzipped
Languages
TypeScript (67.25%)
JavaScript (32.21%)
Shell (0.53%)
Total Downloads
Cumulative downloads
Total Downloads
10,309,670
Last day
-19.7%
19,119
Compared to previous day
Last week
-8.1%
110,695
Compared to previous week
Last month
7.9%
476,139
Compared to previous month
Last year
29.2%
4,599,505
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
2
Peer Dependencies
1
Dev Dependencies
28
:zap: Esbuild Runner (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.
✨ Usage
The easiest way to use esbuild-runner is to install it globally and use the included esr
binary.
1$ esr hello-world.ts
Alternatively, you can require esbuild-runner within any nodejs process to include realtime transpilation:
1$ 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
1module.exports = { 2 transform: { 3 "\\.ts$": "esbuild-runner/jest", 4 }, 5}
VSCode Debugging
1{ 2 "version": "0.2.0", 3 "configurations": [ 4 { 5 "name": "Debug with esbuild-runner", 6 "program": "${workspaceFolder}/hello-world.ts", 7 "runtimeArgs": [ 8 "-r", 9 "esbuild-runner/register" 10 ], 11 "request": "launch", 12 "sourceMaps": true, 13 "skipFiles": [ 14 "<node_internals>/**" 15 ], 16 "type": "pwa-node" 17 } 18 ] 19}
⚙️ Configuration
esr
provides two different ways to transpile your code:
- bundling (default): this transpiles the script and all its dependencies in typically one invocation of esbuild. Dependencies defined in
package.json
ornode_modules
will never be transpiled. Runningesr
will always transpile the code. No caching is used. - transform (
--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.
1$ bin/esr.js --help 2Usage: esr [options] <source-file> [file-options] 3 4 --cache Transform on a file per file basis and cache code 5 --clearCache Clear transform cache 6 --help|-h Display this help message 7
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.
1// example esbuild-runner.config.js 2module.exports = { 3 type: "bundle", // bundle or transform (see description above) 4 esbuild: { 5 // Any esbuild build or transform options go here 6 target: "esnext", 7 }, 8}
📦 Installation
Simply install the esbuild-runner npm package using your favorite package manager.
- globally ...
1$ npm install -g esbuild-runner
- ... or locally in your project
1$ npm add --dev esbuild-runner
👋 Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
⚖ License
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0
Reason
Found 3/26 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/node.js.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/folke/esbuild-runner/node.js.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node.js.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/folke/esbuild-runner/node.js.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: .github/workflows/node.js.yml:27
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 npmCommand dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 12 are checked with a SAST tool
Reason
20 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-7jxr-cg7f-gpgv
- Warn: Project is vulnerable to: GHSA-xj72-wvfv-8985
- Warn: Project is vulnerable to: GHSA-ch3r-j5x3-6q2m
- Warn: Project is vulnerable to: GHSA-p5gc-c584-jj6v
- Warn: Project is vulnerable to: GHSA-whpj-8f3w-67p5
- Warn: Project is vulnerable to: GHSA-cchq-frgv-rjh5
- Warn: Project is vulnerable to: GHSA-g644-9gfx-q4q4
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
Score
2.6
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to esbuild-runner
synckit
Perform async work synchronously in Node.js using `worker_threads` with first-class TypeScript support.
@angular-devkit/build-angular
Angular Webpack Build Facade
@esbuild/linux-x64
The Linux 64-bit binary for esbuild, a JavaScript bundler.
esbuild
An extremely fast JavaScript and CSS bundler and minifier.