diff options
Diffstat (limited to 'docs/runtime')
-rw-r--r-- | docs/runtime/configuration.md | 3 | ||||
-rw-r--r-- | docs/runtime/nodejs-apis.md | 16 | ||||
-rw-r--r-- | docs/runtime/typescript.md | 11 |
3 files changed, 22 insertions, 8 deletions
diff --git a/docs/runtime/configuration.md b/docs/runtime/configuration.md index e1572c990..2ae81713a 100644 --- a/docs/runtime/configuration.md +++ b/docs/runtime/configuration.md @@ -129,6 +129,9 @@ peer = false # equivalent to `--production` flag production = false +# equivalent to `--frozen-lockfile` flag +frozenLockfile = false + # equivalent to `--dry-run` flag dryRun = false ``` diff --git a/docs/runtime/nodejs-apis.md b/docs/runtime/nodejs-apis.md index ac42559a0..3dfe76b97 100644 --- a/docs/runtime/nodejs-apis.md +++ b/docs/runtime/nodejs-apis.md @@ -1,6 +1,6 @@ Bun aims for complete Node.js API compatibility. Most `npm` packages intended for `Node.js` environments will work with Bun out of the box; the best way to know for certain is to try it. -This page is updated regularly to reflect compatibility status of the latest version of Bun. +This page is updated regularly to reflect compatibility status of the latest version of Bun. If you run into any bugs with a particular package, please [open an issue](https://bun.sh/issues). Opening issues for compatibility bugs helps us prioritize what to work on next. ## Built-in modules @@ -51,7 +51,7 @@ This page is updated regularly to reflect compatibility status of the latest ver - {% anchor id="node_crypto" %} [`node:crypto`](https://nodejs.org/api/crypto.html) {% /anchor %} - 🟡 -- Missing `crypto.Certificate` `crypto.ECDH` `crypto.KeyObject` `crypto.X509Certificate` `crypto.checkPrime{Sync}` `crypto.createPrivateKey` `crypto.createPublicKey` `crypto.createSecretKey` `crypto.diffieHellman` `crypto.generateKey{Sync}` `crypto.generateKeyPair{Sync}` `crypto.generatePrime{Sync}` `crypto.getCipherInfo` `crypto.getCurves` `crypto.{get|set}Fips` `crypto.hkdf` `crypto.hkdfSync` `crypto.randomInt` `crypto.secureHeapUsed` `crypto.setEngine` `crypto.sign` `crypto.verify` +- Missing `crypto.Certificate` `crypto.ECDH` `crypto.KeyObject` `crypto.X509Certificate` `crypto.checkPrime{Sync}` `crypto.createPrivateKey` `crypto.createPublicKey` `crypto.createSecretKey` `crypto.diffieHellman` `crypto.generateKey{Sync}` `crypto.generateKeyPair{Sync}` `crypto.generatePrime{Sync}` `crypto.getCipherInfo` `crypto.{get|set}Fips` `crypto.hkdf` `crypto.hkdfSync` `crypto.secureHeapUsed` `crypto.setEngine` `crypto.sign` `crypto.verify` --- @@ -87,7 +87,7 @@ This page is updated regularly to reflect compatibility status of the latest ver - {% anchor id="node_fs" %} [`node:fs`](https://nodejs.org/api/fs.html) {% /anchor %} - 🟡 -- Missing `fs.fdatasync{Sync}` `fs.opendir{Sync}` `fs.readv{Sync}` `fs.{watch|watchFile|unwatchFile}` `fs.writev{Sync}`. +- Missing `fs.fdatasync{Sync}` `fs.opendir{Sync}` `fs.{watchFile|unwatchFile}` `fs.{cp|cpSync}`. --- @@ -123,7 +123,7 @@ This page is updated regularly to reflect compatibility status of the latest ver - {% anchor id="node_net" %} [`node:net`](https://nodejs.org/api/net.html) {% /anchor %} - 🟡 -- Missing `net.createServer` `net.{get|set}DefaultAutoSelectFamily` `net.SocketAddress` `net.BlockList`. +- Missing `net.{get|set}DefaultAutoSelectFamily` `net.SocketAddress` `net.BlockList`. --- @@ -201,7 +201,7 @@ This page is updated regularly to reflect compatibility status of the latest ver - {% anchor id="node_tls" %} [`node:tls`](https://nodejs.org/api/tls.html) {% /anchor %} - 🟡 -- Missing `tls.Server` `tls.createServer` `tls.createSecurePair` `tls.checkServerIdentity` `tls.rootCertificates` +- Missing `tls.createSecurePair` `tls.checkServerIdentity` `tls.rootCertificates` --- @@ -219,13 +219,13 @@ This page is updated regularly to reflect compatibility status of the latest ver - {% anchor id="node_url" %} [`node:url`](https://nodejs.org/api/url.html) {% /anchor %} - 🟡 -- Missing `url.domainTo{ASCII|Unicode}` `url.urlToHttpOptions`. Recommended to use `URL` and `URLSearchParams` globals instead. +- Missing `url.domainTo{ASCII|Unicode}`. Recommended to use `URL` and `URLSearchParams` globals instead. --- - {% anchor id="node_util" %} [`node:util`](https://nodejs.org/api/util.html) {% /anchor %} - 🟡 -- Missing `util.MIMEParams` `util.MIMEType` `util.formatWithOptions()` `util.getSystemErrorMap()` `util.getSystemErrorName()` `util.parseArgs()` `util.stripVTControlCharacters()` `util.toUSVString()` `util.transferableAbortController()` `util.transferableAbortSignal()`. +- Missing `util.MIMEParams` `util.MIMEType` `util.formatWithOptions()` `util.getSystemErrorMap()` `util.getSystemErrorName()` `util.parseArgs()` `util.stripVTControlCharacters()` `util.transferableAbortController()` `util.transferableAbortSignal()`. --- @@ -558,7 +558,7 @@ The table below lists all globals implemented by Node.js and Bun's current compa - {% anchor id="node_require" %} [`require()`](https://nodejs.org/api/globals.html#require) {% /anchor %} - 🟢 -- Fully implemented. +- Fully implemented, as well as [`require.main`](https://nodejs.org/api/modules.html#requiremain), [`require.cache`](https://nodejs.org/api/modules.html#requirecache), and [`require.resolve`](https://nodejs.org/api/modules.html#requireresolverequest-options) --- diff --git a/docs/runtime/typescript.md b/docs/runtime/typescript.md index d466bb016..b79b1ec6d 100644 --- a/docs/runtime/typescript.md +++ b/docs/runtime/typescript.md @@ -93,6 +93,17 @@ These are the recommended `compilerOptions` for a Bun project. } ``` +### Add DOM types + +Settings `"types": ["bun-types"]` means TypeScript will ignore other global type definitions, including `lib: ["dom"]`. To add DOM types into your project, add the following [triple-slash directives](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html) at the top of any TypeScript file in your project. + +```ts +/// <reference lib="dom" /> +/// <reference lib="dom.iterable" /> +``` + +The same applies to other global type definition _libs_ like `webworker`. + ## Path mapping When resolving modules, Bun's runtime respects path mappings defined in [`compilerOptions.paths`](https://www.typescriptlang.org/tsconfig#paths) in your `tsconfig.json`. No other runtime does this. |