Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@esbuild/darwin-x64
Advanced tools
The @esbuild/darwin-x64 npm package is a binary package for the esbuild bundler optimized for macOS on x64 architectures. Esbuild is a fast JavaScript bundler and minifier. It compiles TypeScript and JavaScript into efficient code that can be executed in the browser or on Node.js. This package specifically contains the esbuild binary for macOS (Darwin) systems with x64 architecture, facilitating web development tasks such as bundling, minification, and transpilation.
JavaScript and TypeScript Bundling
This feature allows you to bundle multiple JavaScript or TypeScript files into a single file. The code sample demonstrates how to bundle an entry file named 'app.js' into an output file named 'out.js'.
require('esbuild').build({
entryPoints: ['app.js'],
bundle: true,
outfile: 'out.js'
}).catch(() => process.exit(1))
Minification
This feature enables the minification of JavaScript files to reduce their size by removing unnecessary characters without changing their functionality. The code sample shows how to minify an entry file 'app.js' into a minified output file 'out.min.js'.
require('esbuild').build({
entryPoints: ['app.js'],
minify: true,
outfile: 'out.min.js'
}).catch(() => process.exit(1))
Transpilation
This feature allows for the transpilation of TypeScript code into JavaScript, making it compatible with older browsers or environments that do not support TypeScript natively. The code sample demonstrates bundling and transpiling a TypeScript file 'app.ts' into a JavaScript file 'out.js'.
require('esbuild').build({
entryPoints: ['app.ts'],
bundle: true,
outfile: 'out.js',
loader: { '.ts': 'ts' }
}).catch(() => process.exit(1))
Webpack is a powerful module bundler for JavaScript applications. It offers a wide range of plugins and loaders to transform, bundle, or package almost any resource or asset. Compared to @esbuild/darwin-x64, webpack is more feature-rich and configurable but generally slower in terms of build speed.
Rollup is another JavaScript module bundler that focuses on producing efficient bundles for modern module formats like ES6. It's known for its simplicity and efficiency, especially for library authors. Rollup is similar to @esbuild/darwin-x64 in terms of speed and efficiency but lacks some of the more advanced optimization features found in esbuild.
Parcel is a web application bundler that offers out-of-the-box support for many web development languages and tools without the need for configuration. It's designed to be fast, utilizing multicore processing for efficient builds. Compared to @esbuild/darwin-x64, Parcel provides a more integrated development experience with less focus on manual configuration.
This is the macOS 64-bit binary for esbuild, a JavaScript bundler and minifier. See https://github.com/evanw/esbuild for details.
0.24.1
Allow es2024
as a target in tsconfig.json
(#4004)
TypeScript recently added es2024
as a compilation target, so esbuild now supports this in the target
field of tsconfig.json
files, such as in the following configuration file:
{
"compilerOptions": {
"target": "ES2024"
}
}
As a reminder, the only thing that esbuild uses this field for is determining whether or not to use legacy TypeScript behavior for class fields. You can read more in the documentation.
This fix was contributed by @billyjanitsch.
Allow automatic semicolon insertion after get
/set
This change fixes a grammar bug in the parser that incorrectly treated the following code as a syntax error:
class Foo {
get
*x() {}
set
*y() {}
}
The above code will be considered valid starting with this release. This change to esbuild follows a similar change to TypeScript which will allow this syntax starting with TypeScript 5.7.
Allow quoted property names in --define
and --pure
(#4008)
The define
and pure
API options now accept identifier expressions containing quoted property names. Previously all identifiers in the identifier expression had to be bare identifiers. This change now makes --define
and --pure
consistent with --global-name
, which already supported quoted property names. For example, the following is now possible:
// The following code now transforms to "return true;\n"
console.log(esbuild.transformSync(
`return process.env['SOME-TEST-VAR']`,
{ define: { 'process.env["SOME-TEST-VAR"]': 'true' } },
))
Note that if you're passing values like this on the command line using esbuild's --define
flag, then you'll need to know how to escape quote characters for your shell. You may find esbuild's JavaScript API more ergonomic and portable than writing shell code.
Minify empty try
/catch
/finally
blocks (#4003)
With this release, esbuild will now attempt to minify empty try
blocks:
// Original code
try {} catch { foo() } finally { bar() }
// Old output (with --minify)
try{}catch{foo()}finally{bar()}
// New output (with --minify)
bar();
This can sometimes expose additional minification opportunities.
Include entryPoint
metadata for the copy
loader (#3985)
Almost all entry points already include a entryPoint
field in the outputs
map in esbuild's build metadata. However, this wasn't the case for the copy
loader as that loader is a special-case that doesn't behave like other loaders. This release adds the entryPoint
field in this case.
Source mappings may now contain null
entries (#3310, #3878)
With this change, sources that result in an empty source map may now emit a null
source mapping (i.e. one with a generated position but without a source index or original position). This change improves source map accuracy by fixing a problem where minified code from a source without any source mappings could potentially still be associated with a mapping from another source file earlier in the generated output on the same minified line. It manifests as nonsensical files in source mapped stack traces. Now the null
mapping "resets" the source map so that any lookups into the minified code without any mappings resolves to null
(which appears as the output file in stack traces) instead of the incorrect source file.
This change shouldn't affect anything in most situations. I'm only mentioning it in the release notes in case it introduces a bug with source mapping. It's part of a work-in-progress future feature that will let you omit certain unimportant files from the generated source map to reduce source map size.
Avoid using the parent directory name for determinism (#3998)
To make generated code more readable, esbuild includes the name of the source file when generating certain variable names within the file. Specifically bundling a CommonJS file generates a variable to store the lazily-evaluated module initializer. However, if a file is named index.js
(or with a different extension), esbuild will use the name of the parent directory instead for a better name (since many packages have files all named index.js
but have unique directory names).
This is problematic when the bundle entry point is named index.js
and the parent directory name is non-deterministic (e.g. a temporary directory created by a build script). To avoid non-determinism in esbuild's output, esbuild will now use index
instead of the parent directory in this case. Specifically this will happen if the parent directory is equal to esbuild's outbase
API option, which defaults to the lowest common ancestor of all user-specified entry point paths.
Experimental support for esbuild on NetBSD (#3974)
With this release, esbuild now has a published binary executable for NetBSD in the @esbuild/netbsd-arm64
npm package, and esbuild's installer has been modified to attempt to use it when on NetBSD. Hopefully this makes installing esbuild via npm work on NetBSD. This change was contributed by @bsiegert.
⚠️ Note: NetBSD is not one of Node's supported platforms, so installing esbuild may or may not work on NetBSD depending on how Node has been patched. This is not a problem with esbuild. ⚠️
FAQs
The macOS 64-bit binary for esbuild, a JavaScript bundler.
The npm package @esbuild/darwin-x64 receives a total of 5,950,446 weekly downloads. As such, @esbuild/darwin-x64 popularity was classified as popular.
We found that @esbuild/darwin-x64 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.