2023-10-28 07:50:54 +00:00
|
|
|
# Deno Standard Library
|
2018-11-07 19:28:47 +00:00
|
|
|
|
2021-03-17 08:30:10 +00:00
|
|
|
[![codecov](https://codecov.io/gh/denoland/deno_std/branch/main/graph/badge.svg?token=w6s3ODtULz)](https://codecov.io/gh/denoland/deno_std)
|
2023-10-28 07:50:54 +00:00
|
|
|
[![ci](https://github.com/denoland/deno_std/actions/workflows/ci.yml/badge.svg)](https://github.com/denoland/deno_std/actions/workflows/ci.yml)
|
2021-03-17 08:30:10 +00:00
|
|
|
|
2023-10-28 07:50:54 +00:00
|
|
|
High-quality APIs for [Deno](https://deno.com/) and the web. Use fearlessly.
|
2019-01-03 16:40:09 +00:00
|
|
|
|
2023-10-28 07:50:54 +00:00
|
|
|
## Get Started
|
2019-01-03 16:40:09 +00:00
|
|
|
|
2023-10-28 07:50:54 +00:00
|
|
|
```ts
|
|
|
|
import { copy } from "https://deno.land/std@$STD_VERSION/fs/copy.ts";
|
2021-02-03 20:47:28 +00:00
|
|
|
|
2023-10-28 07:50:54 +00:00
|
|
|
await copy("./foo", "./bar");
|
|
|
|
```
|
2021-02-03 20:47:28 +00:00
|
|
|
|
2023-10-28 07:50:54 +00:00
|
|
|
See [here](#recommended-usage) for recommended usage patterns.
|
2021-02-03 20:47:28 +00:00
|
|
|
|
2023-10-28 07:50:54 +00:00
|
|
|
## Documentation
|
2019-01-03 16:40:09 +00:00
|
|
|
|
2023-10-28 07:50:54 +00:00
|
|
|
Check out the documentation [here](https://deno.land/std?doc).
|
2019-01-03 16:40:09 +00:00
|
|
|
|
2023-10-28 07:50:54 +00:00
|
|
|
## Recommended Usage
|
2020-05-09 12:34:47 +00:00
|
|
|
|
2023-10-28 07:50:54 +00:00
|
|
|
1. Include the version of the library in the import specifier.
|
2020-05-09 12:34:47 +00:00
|
|
|
|
2023-10-28 07:50:54 +00:00
|
|
|
Good:
|
|
|
|
```ts
|
|
|
|
import { copy } from "https://deno.land/std@0.204.0/fs/copy.ts";
|
|
|
|
```
|
2020-05-09 12:34:47 +00:00
|
|
|
|
2023-10-28 07:50:54 +00:00
|
|
|
1. Only import modules that you require.
|
2020-07-11 04:52:18 +00:00
|
|
|
|
2023-10-28 07:50:54 +00:00
|
|
|
Bad (when using only one function):
|
|
|
|
```ts
|
|
|
|
import * as fs from "https://deno.land/std@$STD_VERSION/fs/mod.ts";
|
|
|
|
```
|
2018-12-24 15:28:01 +00:00
|
|
|
|
2023-10-28 07:50:54 +00:00
|
|
|
Good (when using only one function):
|
|
|
|
```ts
|
|
|
|
import { copy } from "https://deno.land/std@$STD_VERSION/fs/copy.ts";
|
|
|
|
```
|
|
|
|
|
|
|
|
Good (when using multiple functions):
|
|
|
|
```ts
|
|
|
|
import * as fs from "https://deno.land/std@$STD_VERSION/fs/mod.ts";
|
|
|
|
```
|
|
|
|
|
|
|
|
1. Do not import symbols with an underscore in the name.
|
|
|
|
|
|
|
|
Bad:
|
|
|
|
```ts
|
|
|
|
import { _format } from "https://deno.land/std@$STD_VERSION/path/_common/format.ts";
|
|
|
|
```
|
2019-04-13 19:30:56 +00:00
|
|
|
|
2023-10-28 07:50:54 +00:00
|
|
|
1. Do not import modules with an underscore in the path.
|
2020-05-09 12:34:47 +00:00
|
|
|
|
2023-10-28 07:50:54 +00:00
|
|
|
Bad:
|
|
|
|
```ts
|
|
|
|
import { filterInPlace } from "https://deno.land/std@$STD_VERSION/collections/_utils.ts";
|
|
|
|
```
|
|
|
|
|
|
|
|
1. Do not import test modules or test data.
|
|
|
|
|
|
|
|
Bad:
|
|
|
|
```ts
|
|
|
|
import { test } from "https://deno.land/std@$STD_VERSION/front_matter/test.ts";
|
|
|
|
```
|
2019-04-13 19:30:56 +00:00
|
|
|
|
2019-02-12 23:23:49 +00:00
|
|
|
## Contributing
|
2019-01-04 04:13:21 +00:00
|
|
|
|
2023-10-25 04:21:05 +00:00
|
|
|
Check out the contributing guidelines [here](./CONTRIBUTING.md).
|
2023-10-28 07:50:54 +00:00
|
|
|
|
|
|
|
## Releases
|
|
|
|
|
|
|
|
The Standard Library is versioned independently of the Deno CLI. This will
|
|
|
|
change once the Standard Library is stabilized. See
|
|
|
|
[here](https://raw.githubusercontent.com/denoland/dotland/main/versions.json)
|
|
|
|
for the compatibility of different versions of the Deno Standard Library and the
|
|
|
|
Deno CLI.
|