最近、色々なライブラリをCommonJS(CJS)からECMAScript Module(ESM)へとマイグレーションしています。 その際に、ESMでは__dirnameやrequireなどCommonJS特有の機能は使えなくなっています。 また、TypeScriptやBabelなど多くのツールはCJSではimport時に拡張子はなくても大丈夫ですが、ESMの場合はimport時に拡張子が必要になります。 import url from "node:url"; - import { mdEscape } from "./mdEscape"; + import { mdEscape } from "./mdEscape.js"; // ESMでは相対パスに拡張子は省略できない + const __filename = url.fileURLToPath(import.meta.url); /
Snowpack v3.0 is here! This is our biggest release yet with brand new features including: Pre-bundled streaming imports - Import any npm package, on-demand.Integrated build optimizations - Built-in bundling, preloading, minification, and more.JavaScript API - Integrate with Snowpack’s brand new native JS API.Node.js Runtime API - Import your Snowpack-built files directly into Node.js.Bug fixes, st
This is a tool that converts CommonJS modules into tree-shakeable ES Modules. This allows you to not only bundle CommonJS modules for the browser, but also makes it possible for you to bundle them in modern tools such as Rollup. It can also be used as a tool for migrating a CommonJS-based codebase to one based on ES-modules via a simple CLI. cjstoesm can be used from the Command Line, as a JavaScr
reg is a package manager for native ES Modules. It's built to enable dependency management for Universal JavaScript (JavaScript that can run in the Browser and in Node.js w/o a compiler). This library is highly experimental and still likely to break without notice. DO NOT USE THIS IN PRODUCTION. Supporting Universal JavaScript is quite difficult as the Browser's module system has a very unique set
Releases, Offers & More Be the first to hear about our newest content, best promotions and upcoming events. Plus get 25% off your next purchase. Newsletter Sign Up Download Accounts Your email address is your account identifier. You can create a password, or just download from the links sent via email. My Orders (Resend order emails) How We're Different Hands-on instructions Solutions to real-worl
Comparison table of `this` value. Show the result of your browser. Method version: What is `this` value in method
I’m excited to announce the release of @std/esm (standard/esm), an opt-in, spec-compliant, ECMAScript (ES) module loader that enables a smooth transition between Node and ES module formats with near built-in performance! This fast, small, zero-dependency package is all you need to enable ES modules in Node today 🎉🎉🎉 @std/esm used in the Node REPL after `npm --save @std/esm`A tale of two module
Usage: eslump [options] or: eslump TEST_FILE OUTPUT_DIR [options] Options: --max-depth Number The maximum depth of the random JavaScript. - default: 7 --source-type String Parsing mode. - either: module or script - default: module --whitespace Randomize the whitespace in the random JavaScript. --comments Insert random comments into the random JavaScript. -r, --reproduce Reproduce a previous error
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く