2018-12-18 23:25:49 +00:00
|
|
|
# Deno Standard Modules
|
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)
|
|
|
|
|
2019-01-15 17:28:09 +00:00
|
|
|
These modules do not have external dependencies and they are reviewed by the
|
|
|
|
Deno core team. The intention is to have a standard set of high quality code
|
|
|
|
that all Deno projects can use fearlessly.
|
2019-01-03 16:40:09 +00:00
|
|
|
|
2019-01-15 17:28:09 +00:00
|
|
|
Contributions are welcome!
|
2019-01-03 16:40:09 +00:00
|
|
|
|
2021-02-03 20:47:28 +00:00
|
|
|
## Releases
|
|
|
|
|
|
|
|
Standard library is currently tagged independently of Deno version. This will
|
|
|
|
change once the library is stabilized.
|
|
|
|
|
|
|
|
To check compatibility of different version of standard library with Deno CLI
|
|
|
|
see
|
2022-03-06 11:44:54 +00:00
|
|
|
[this list](https://raw.githubusercontent.com/denoland/dotland/main/versions.json).
|
2021-02-03 20:47:28 +00:00
|
|
|
|
2019-01-15 17:28:09 +00:00
|
|
|
## How to use
|
2019-01-03 16:40:09 +00:00
|
|
|
|
2020-06-28 16:25:20 +00:00
|
|
|
These modules will eventually be tagged in accordance with Deno releases but as
|
|
|
|
of today we do not yet consider them stable and so we version the standard
|
|
|
|
modules differently from the Deno runtime to reflect this.
|
2019-01-03 16:40:09 +00:00
|
|
|
|
2020-05-09 12:34:47 +00:00
|
|
|
It is strongly recommended that you link to tagged releases to avoid unintended
|
2020-06-28 16:25:20 +00:00
|
|
|
updates and breaking changes.
|
2020-05-09 12:34:47 +00:00
|
|
|
|
|
|
|
Don't link to / import any module whose path:
|
|
|
|
|
|
|
|
- Has a name or parent with an underscore prefix: `_foo.ts`, `_util/bar.ts`.
|
|
|
|
- Is that of a test module or test data: `test.ts`, `foo_test.ts`,
|
|
|
|
`testdata/bar.txt`.
|
|
|
|
|
2020-07-11 04:52:18 +00:00
|
|
|
Don't import any symbol with an underscore prefix: `export function _baz() {}`.
|
|
|
|
|
|
|
|
These elements are not considered part of the public API, thus no stability is
|
|
|
|
guaranteed for them.
|
2018-12-24 15:28:01 +00:00
|
|
|
|
2019-04-13 19:30:56 +00:00
|
|
|
## Documentation
|
|
|
|
|
2020-05-09 12:34:47 +00:00
|
|
|
To browse documentation for modules:
|
|
|
|
|
|
|
|
- Go to https://deno.land/std/.
|
2020-07-11 04:52:18 +00:00
|
|
|
- Click "View Documentation".
|
2022-11-27 19:00:03 +00:00
|
|
|
- Navigate to any module of interest.
|
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
|
|
|
|
2021-02-01 11:43:02 +00:00
|
|
|
**NOTE: This repository was unarchived and synced on Feb, 1st, 2021. If you
|
|
|
|
already had it cloned, we suggest to do a fresh clone to avoid git conflicts.**
|
|
|
|
|
2019-05-16 20:23:25 +00:00
|
|
|
deno_std is a loose port of [Go's standard library](https://golang.org/pkg/).
|
2019-10-09 21:22:22 +00:00
|
|
|
When in doubt, simply port Go's source code, documentation, and tests. There are
|
|
|
|
many times when the nature of JavaScript, TypeScript, or Deno itself justifies
|
|
|
|
diverging from Go, but if possible we want to leverage the energy that went into
|
|
|
|
building Go. We generally welcome direct ports of Go's code.
|
2019-05-16 20:23:25 +00:00
|
|
|
|
|
|
|
Please ensure the copyright headers cite the code's origin.
|
|
|
|
|
2020-07-14 12:54:13 +00:00
|
|
|
Follow the [style guide](https://deno.land/manual/contributing/style_guide).
|
2021-02-01 11:43:02 +00:00
|
|
|
|
2021-02-03 20:47:28 +00:00
|
|
|
### Opening a pull request
|
2021-02-01 11:43:02 +00:00
|
|
|
|
2021-10-10 12:24:58 +00:00
|
|
|
After cloning don't forget to `git submodule update --init`.
|
|
|
|
|
2021-02-03 20:47:28 +00:00
|
|
|
Before opening a PR make sure to:
|
2021-02-01 11:43:02 +00:00
|
|
|
|
2022-03-17 16:31:32 +00:00
|
|
|
- have the latest Deno version installed locally
|
|
|
|
- add tests that cover your changes.
|
2022-03-18 11:53:53 +00:00
|
|
|
- `deno task test` passes.
|
2022-06-11 10:06:23 +00:00
|
|
|
- `deno fmt --check` passes.
|
2022-08-30 04:27:54 +00:00
|
|
|
- `deno task lint` passes.
|
2023-06-26 06:23:09 +00:00
|
|
|
- (optionally) check for typos with `deno task typos` (requires
|
|
|
|
[typos](https://github.com/crate-ci/typos#install) to be installed)
|
2021-02-03 20:47:28 +00:00
|
|
|
|
|
|
|
Give the PR a descriptive title.
|
|
|
|
|
2021-11-19 21:45:41 +00:00
|
|
|
Examples of good titles:
|
2021-02-03 20:47:28 +00:00
|
|
|
|
|
|
|
- fix(http): Fix race condition in server
|
|
|
|
- docs(fmt): Update docstrings
|
|
|
|
- feat(log): Handle nested messages
|
|
|
|
|
2021-11-19 21:45:41 +00:00
|
|
|
Examples of bad titles:
|
2021-02-03 20:47:28 +00:00
|
|
|
|
|
|
|
- fix #7123
|
|
|
|
- update docs
|
|
|
|
- fix bugs
|
|
|
|
|
|
|
|
Ensure there is a related issue and it is referenced in the PR text.
|
2021-02-01 11:43:02 +00:00
|
|
|
|
2021-09-08 16:28:31 +00:00
|
|
|
_About CI checks_:
|
|
|
|
|
2023-04-03 03:45:37 +00:00
|
|
|
We currently have 6 checks on CI. Each PR should pass all of these checks to be
|
2021-09-24 13:44:56 +00:00
|
|
|
accepted.
|
2021-09-08 16:28:31 +00:00
|
|
|
|
|
|
|
- test with Deno canary on Windows
|
|
|
|
- test with Deno canary on Linux
|
|
|
|
- test with Deno canary on macOS
|
2021-09-24 13:44:56 +00:00
|
|
|
- lint
|
|
|
|
- wasm crypto check
|
|
|
|
- CLA
|
2021-09-08 16:28:31 +00:00
|
|
|
|
2021-02-01 11:43:02 +00:00
|
|
|
_For maintainers_:
|
|
|
|
|
|
|
|
To release a new version a tag in the form of `x.y.z` should be added.
|
2022-11-10 07:28:20 +00:00
|
|
|
|
2022-12-23 05:33:12 +00:00
|
|
|
### Types
|
|
|
|
|
|
|
|
Deno is moving away from non-native IO functions and interfaces in favor of the
|
|
|
|
[Streams API](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API).
|
|
|
|
These types are to be defined here, in the Standard Library, instead of in the
|
|
|
|
Deno namespace in the future. As a rule, use the following corresponding and
|
|
|
|
identical types from `types.d.ts`:
|
|
|
|
|
|
|
|
- `Deno.Reader`
|
|
|
|
- `Deno.Writer`
|
|
|
|
- `Deno.ReaderSync`
|
|
|
|
- `Deno.WriterSync`
|
|
|
|
- `Deno.Closer`
|
|
|
|
|
|
|
|
See the tracking issue [here](https://github.com/denoland/deno/issues/9795).
|