mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
The Deno Standard Library
9298ea503f
* refactor(archive): An implementation of Tar as streams * fmt(archive): Ran `deno fmt` * fix(archive): fixed JSDoc examples in tar_streams.ts * fix(archive): fixed JSDoc examples so `deno task test` doesn't complain * fix(archive): lint license error * fix(archive): lint error files not exported * set(archive): Set current time as mtime for default * resolve(archive): resolves comments made * add(archive): `{ mode: 'byob' }` support for TarStream * add(archive): `{ mode: 'byob' }` support for UnTarStream * adjust(archive): The logical flow of a few if statements * tests(archive): Updated Tests for Un/TarStream * fix(archive): TarStream mtime wasn't an octal * fix(archive): TarStream tests * add(archive): Added parsePathname function Added parsePathname function abstracting the logic out of TarStream allowing the developer to validate pathnames before providing them to TarStream hoping it doesn't throw an error and require the archive creation to start all over again. * fix(archive): extra bytes incorrectly appending at the end of files When the appending file was exactly divisible by 512 bytes, an extra 512 bytes was being appending instead of zero to fill in the gap, causing the next header to be read at the wrong place. * adjust(archive): to always return the amount of bytes requested Instead of using enqueue, the leftover bytes are saved for later for the next buffer provided. * tweaks * fix * docs(archive): Link to the spec that they're following * docs(archive): fix spelling * add(archive): function validTarSteamOptions - To make sure, if TarStreamOptions are being provided, that they are in the correct format so as to not create bad tarballs. * add(archive): more tests * fix(archive): validTarStreamOptions * add(archive): tests for validTarStreamOptions * refactor(archive): code to copy the changes made in the @doctor/tar-stream version * test(archive): added from @doctor/tar-stream * chore: nit on anonymous function * refactor(archive): UnTarStream that fixes unexplainable memory leak - The second newest test introduced here '... with invalid ending' seems to detect a memory leak due to an invalid tarball. I couldn't figure out why the memory leak was happening but I know this restructure of the code doesn't have that same memory leak. * chore: fmt * tests(archive): added remaining tests to cover many lines as possible * adjust(archive): remove simplify pathname code * adjust(archive): remove checking for duplicate pathnames in taring process * adjust(archive): A readable will exist on TarEntry unless string values 1-6 * tests(archive): added more tests for higher coverage * adjust(archives): TarStream and UnTarStream to implement TransformStream * docs(archive): moved TarStreamOptions docs into properties. * adjust(archive): TarStreamFile to take a ReadableSteam instead of an Iterable | AsyncIterable * adjust(archive): to use FixedChunkStream instead of rolling it's own implementation * fix(archive): lint error * adjust(archive): Error types and messages * adjust(archive): more Error messages / improve tests * refactor(archive): UnTarStream to return TarStreamChunk instead of TarStreamEntry * fix(archive): JSDoc example * adjust(archive): mode, uid, gid options to be provided as numbers instead of strings. * adjust(archive): TarStream's pathname to be only of type string * fix(archive): prefix/name to ignore everything past the first NULL * adjust(archive): `checksum` and `pad` to not be exposed from UnTarStream * adjust(archive): checksum calculation * change(archive): `.slice` to `.subarray` * doc(archive): "octal number" to "octal literal" * adjust(archive): TarStreamOptions to be optional with defaults * doc(archive): added more docs for the interfaces * docs(archive): denoting defaults * docs(archive): updated for new lint rules * adjust(archive): Tests to use assertRejects where appropriate & add `validPathname` function - The `validPathname` is meant to be a nicer exposed function for users of this lib to validate that their pathnames are valid before pipping it through the TarStream, over exposing parsePathname where the user may be confused about what to do with the result. * adjust(archive): to use `Date.now()` instead of `new Date().getTime()` Co-authored-by: ud2 <sjx233@qq.com> * adjust(archive): mode, uid, and gid to be numbers instead of strings when Untaring * tests(archive): adjust two tests to also validate the contents of the files are valid * adjust(archive): linkname, uname, and gname to follow the same decoding rules as name and prefix * rename(archive): UnTarStream to UntarStream * fix(archive): type that was missed getting updated * tests(archive): adjust check headers test to validate all header properties instead of just pathnames * rename(archive): `pathname` properties to `path` * docs(archive): updated to be more descriptive * docs(archive): Updated error types * adjust(archive): `validPath` to `assertValidPath` * adjust(archive): `validTarStreamOptions` to `assertValidTarStreamOptions` * revert(archive): UntarStream to produce TarStreamEntry instead of TarStreamChunk * refactor: remove redundant `void` return types * docs: cleanup assertion function docs * docs: correct `TarStream` example * docs: minor docs cleanups * refactor: improve error class specificity * docs: add `@experimental` JSDoc tags * docs(archive): Updated examples for `assertValidPath` and `assertValidTarStreamOptions``` * fix(archive): problem with tests - I suspect the problem is that a file that was read by `Deno.readDir` changed size between being read at `Deno.stat` and when `Deno.open` finished pulling it all in. * update error messages * update error messages * fix typos * refactor: tweak error messages * refactor: tweaks and add type field --------- Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com> Co-authored-by: ud2 <sjx233@qq.com> Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com> |
||
---|---|---|
_tools | ||
.github | ||
.vscode | ||
archive | ||
assert | ||
async | ||
bytes | ||
cache | ||
cli | ||
collections | ||
crypto | ||
csv | ||
data_structures | ||
datetime | ||
dotenv | ||
encoding | ||
expect | ||
fmt | ||
front_matter | ||
fs | ||
html | ||
http | ||
ini | ||
internal | ||
io | ||
json | ||
jsonc | ||
log | ||
media_types | ||
msgpack | ||
net | ||
path | ||
regexp | ||
semver | ||
streams | ||
testing | ||
text | ||
toml | ||
ulid | ||
url | ||
uuid | ||
webgpu | ||
yaml | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
badge.svg | ||
browser-compat.tsconfig.json | ||
deno.json | ||
import_map.json | ||
LICENSE | ||
README.md | ||
Releases.md |
Deno Standard Library
High-quality APIs for Deno and the web. Use fearlessly.
Important
Newer versions of the Standard Library are now hosted on JSR. Older versions up till 0.224.0 are still available at deno.land/std.
Packages
The following list contains links to the Standard Library's packages and documentation:
Package | Latest version |
---|---|
archive | |
assert | |
async | |
bytes | |
cache | |
cli | |
collections | |
crypto | |
csv | |
data_structures | |
datetime | |
dotenv | |
encoding | |
expect | |
fmt | |
front_matter | |
fs | |
html | |
http | |
ini | |
io | |
json | |
jsonc | |
log | |
media_types | |
msgpack | |
net | |
path | |
regexp | |
semver | |
streams | |
testing | |
text | |
toml | |
ulid | |
url | |
uuid | |
webgpu | |
yaml |
Architecture
Check out the architecture guide here.
Design
Check out the design documentation here.
Contributing
Check out the contributing guidelines here.
Releases
Package versions >=1.0.0 follow Semantic Versioning, and package versions <1.0.0 follow this proposal.
Badge
Note
Previously, this repo hosted the badge SVG file. Now, the badge is retrieved directly from Shields.io.
<a href="https://jsr.io/@std">
<img
width="135"
height="20"
src="https://img.shields.io/badge/Built_with_std-blue?logo=deno"
alt="Built with the Deno Standard Library"
/>
</a>
[![Built with the Deno Standard Library](https://img.shields.io/badge/Built_with_std-blue?logo=deno)](https://jsr.io/@std)
Frequently Asked Questions
Check out the frequently asked questions page here.