The Deno Standard Library
Go to file
Joe Hillenbrand 06866a6d47
fix(fs/ensure_dir): allow links to directories (#4132)
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-04-22 20:51:39 +09:00
_tools chore: JSDoc checker (#4618) 2024-04-22 07:07:34 +00:00
.devcontainer chore: add development container configuration (#1938) 2022-02-21 14:23:43 +11:00
.github chore: update Codecov settings (#4623) 2024-04-22 15:50:49 +09:00
archive chore: fix lint error in canary (#4513) 2024-03-22 21:27:04 +01:00
assert refactor(assert,expect): use shared format.ts and diff.ts (#4592) 2024-04-16 17:09:40 +10:00
async test(async): improve test coverage (#4567) 2024-04-12 07:23:54 +10:00
bytes chore: JSDoc checker (#4618) 2024-04-22 07:07:34 +00:00
cli chore: fix types (#4617) 2024-04-22 06:03:29 +00:00
collections chore: update browser-compatible files with declaration (#4560) 2024-04-10 12:43:44 +10:00
console chore: update browser-compatible files with declaration (#4560) 2024-04-10 12:43:44 +10:00
crypto chore: fix types (#4617) 2024-04-22 06:03:29 +00:00
csv fix(csv): do not print empty header line when no columns are given in stringify() (#4610) 2024-04-22 14:12:48 +09:00
data_structures chore: update browser-compatible files with declaration (#4560) 2024-04-10 12:43:44 +10:00
datetime chore: JSDoc checker (#4618) 2024-04-22 07:07:34 +00:00
dotenv chore: update browser-compatible files with declaration (#4560) 2024-04-10 12:43:44 +10:00
encoding chore: simplify deprecation notice check (#4577) 2024-04-17 15:36:50 +09:00
expect refactor(assert,expect): use shared format.ts and diff.ts (#4592) 2024-04-16 17:09:40 +10:00
flags chore: simplify deprecation notice check (#4577) 2024-04-17 15:36:50 +09:00
fmt chore: simplify deprecation notice check (#4577) 2024-04-17 15:36:50 +09:00
front_matter chore: enable verbatim-module-syntax lint rule (#4539) 2024-04-02 00:57:05 +00:00
fs fix(fs/ensure_dir): allow links to directories (#4132) 2024-04-22 20:51:39 +09:00
html refactor(html): prepare for noUncheckedIndexedAccess (#4297) 2024-02-12 14:12:28 +11:00
http feat(http): file server prints local network address (#4604) 2024-04-22 14:25:14 +09:00
ini chore: update browser-compatible files with declaration (#4560) 2024-04-10 12:43:44 +10:00
internal chore: add missing return type (#4595) 2024-04-16 20:03:12 +10:00
io chore: simplify deprecation notice check (#4577) 2024-04-17 15:36:50 +09:00
json refactor: make the code work under verbatimModuleSyntax (#4406) 2024-02-27 21:57:25 +00:00
jsonc docs(jsonc): add module-level docs (#4402) 2024-02-27 19:28:34 +00:00
log fix(log): Revert "deprecate(log): deprecate internal utility methods" (#4436) (#4572) 2024-04-11 19:30:50 +09:00
media_types test(media_types): improve test coverage (#4554) 2024-04-08 15:12:32 +09:00
msgpack chore: update browser-compatible files with declaration (#4560) 2024-04-10 12:43:44 +10:00
net refactor(net): remove use of as Deno.NetAddr (#4574) 2024-04-15 16:47:28 +10:00
path chore: simplify deprecation notice check (#4577) 2024-04-17 15:36:50 +09:00
permissions deprecation(permissions): update removal time for std/permissions (#4575) 2024-04-17 15:23:56 +09:00
regexp docs(regexp): complete documentation (#4319) 2024-02-13 07:32:41 +11:00
semver chore: simplify deprecation notice check (#4577) 2024-04-17 15:36:50 +09:00
streams chore: simplify deprecation notice check (#4577) 2024-04-17 15:36:50 +09:00
testing chore: simplify deprecation notice check (#4577) 2024-04-17 15:36:50 +09:00
text chore: update browser-compatible files with declaration (#4560) 2024-04-10 12:43:44 +10:00
toml refatcor(toml): prepare for noUncheckedIndexedAccess (#4274) 2024-02-04 20:23:55 +09:00
ulid refactor: make the code work under verbatimModuleSyntax (#4406) 2024-02-27 21:57:25 +00:00
url docs(url): polish documentation (#4601) 2024-04-17 14:49:49 +10:00
uuid refactor(uuid): prepare for noUncheckedIndexedAccess (#4445) 2024-03-11 08:59:30 +11:00
webgpu test(webgpu): correct describeTextureFormat() test name (#4584) 2024-04-15 11:36:19 +10:00
yaml chore: simplify deprecation notice check (#4577) 2024-04-17 15:36:50 +09:00
.editorconfig chore: fix .editorconfig syntax (#4376) 2024-02-24 09:51:17 +09:00
.gitattributes Remove std/node, it was merged into Deno itself (#3206) 2023-02-22 10:28:55 -05:00
.gitignore chore: ignore /docs folder (#4112) 2024-01-05 18:55:55 +11:00
badge.svg docs: "Built with deno_std" badge (#3797) 2023-11-24 13:54:28 +11:00
browser-compat.tsconfig.json fix: improve type safety for browser-compatible modules (#995) 2021-07-06 11:15:37 +09:00
deno.json chore: JSDoc checker (#4618) 2024-04-22 07:07:34 +00:00
LICENSE chore: update copyright header (#1871) 2022-02-02 23:21:39 +09:00
README.md docs: improve packages summary (#4614) 2024-04-22 06:47:41 +00:00
Releases.md 0.223.0 (#4588) 2024-04-16 01:31:19 +02:00
version.ts 0.223.0 (#4588) 2024-04-16 01:31:19 +02:00

Deno Standard Library

codecov ci

High-quality APIs for Deno and the web. Use fearlessly.

NOTE: The standard library is also available on JSR - check out the @std scope on JSR here.

Get Started

import { copy } from "https://deno.land/std@$STD_VERSION/fs/copy.ts";

await copy("./foo", "./bar");

See here for recommended usage patterns.

Documentation

Check out the documentation here.

  1. Include the version of the library in the import specifier.

    Good:

    import { copy } from "https://deno.land/std@$STD_VERSION/fs/copy.ts";
    
  2. Only import modules that you require.

    Bad (when using only one function):

    import * as fs from "https://deno.land/std@$STD_VERSION/fs/mod.ts";
    

    Good (when using only one function):

    import { copy } from "https://deno.land/std@$STD_VERSION/fs/copy.ts";
    

    Good (when using multiple functions):

    import * as fs from "https://deno.land/std@$STD_VERSION/fs/mod.ts";
    
  3. Do not import symbols with a name prefixed by an underscore (they're not intended for public use).

    Bad:

    import { _format } from "https://deno.land/std@$STD_VERSION/path/_common/format.ts";
    
  4. Do not import modules with a directory or filename prefixed by an underscore (they're not intended for public use).

    Bad:

    import { createLPS } from "https://deno.land/std@$STD_VERSION/streams/_common.ts";
    

    Good:

    import { TextLineStream } from "https://deno.land/std@$STD_VERSION/streams/text_line_stream.ts";
    
  5. Do not import test modules or test data.

    Bad:

    import { test } from "https://deno.land/std@$STD_VERSION/front_matter/test.ts";
    

Packages

For a package to reach v1 (aka stable) status, it must meet the following requirements:

  1. Approved by four members of the internal team. There must be consensus that the API design is satisfactory and unlikely to change in the future.
  2. 100% documented, passing deno doc --lint checks and adhering to the documentation guidelines.
  3. Maximum possible test coverage
  4. No open issues or pull requests that might lead to breaking changes. For example, issues that suggest new non-breaking features are fine to exist at stabilization.
Package Status Latest version
archive Unstable JSR
assert Settled JSR
async Settled JSR
bytes Settled JSR
cli Unstable JSR
collections Settled JSR
console Unstable JSR
crypto Settled JSR
csv Settled JSR
data_structures Unstable JSR
datetime Unstable JSR
dotenv Unstable JSR
encoding Settled JSR
expect Unstable JSR
flags Deprecated JSR
fmt Settled JSR
front_matter Settled JSR
fs Settled JSR
html Unstable JSR
http Unstable JSR
ini Unstable JSR
io Unstable JSR
json Settled JSR
jsonc Settled JSR
log Unstable JSR
media_types Settled JSR
msgpack Unstable JSR
net Unstable JSR
path Settled JSR
permissions Deprecated JSR
regexp Unstable JSR
semver Unstable JSR
streams Settled JSR
testing Settled JSR
text Unstable JSR
toml Settled JSR
ulid Unstable JSR
url Unstable JSR
uuid Settled JSR
webgpu Unstable JSR
yaml Settled JSR

Note: Settled status means a package is unlikely to have breaking changes, but has not yet achieved v1 status.

Architecture

Check out the architecture guide here.

Design

Minimal Exports

Files are structured to minimize the number of dependencies they incur and the amount of effort required to manage them, both for the maintainer and the user. In most cases, only a single function or class, alongside its related types, are exported. In other cases, functions that incur negligible dependency overhead will be grouped together in the same file.

Deprecation Policy

We deprecate the APIs in the Standard Library when they get covered by new JavaScript language APIs or new Web Standard APIs. These APIs are usually removed after 3 minor versions.

If you still need to use such APIs after the removal for some reason (for example, the usage in Fresh island), please use the URL pinned to the version where they are still available.

For example, if you want to keep using readableStreamFromIterable, which was deprecated and removed in favor of ReadableStream.from in v0.195.0, please use the import URL pinned to v0.194.0:

import { readableStreamFromIterable } from "https://deno.land/std@0.194.0/streams/readable_stream_from_iterable.ts";

Contributing

Check out the contributing guidelines here.

Releases

The Standard Library is versioned independently of the Deno CLI. This will change once the Standard Library is stabilized. See here for the compatibility of different versions of the Deno Standard Library and the Deno CLI.

A new minor version of the Standard Library is published at the same time as every new version of the Deno CLI (including patch versions).

Badge

Built with the Deno Standard Library

<a href="https://deno.land/std">
  <img
    width="135"
    height="20"
    src="https://raw.githubusercontent.com/denoland/deno_std/main/badge.svg"
    alt="Built with the Deno Standard Library"
  />
</a>
[![Built with the Deno Standard Library](https://raw.githubusercontent.com/denoland/deno_std/main/badge.svg)](https://deno.land/std)