0.1.53 • Published 3 months ago

@mitranim/js v0.1.53

Weekly downloads
-
License
Unlicense
Repository
github
Last release
3 months ago

Overview

Kinda "JS standard library" that doesn't suck. Or sucks less than X, insert some alternative here.

Important non-features:

  • Doesn't require Node or Deno.
  • Doesn't require TypeScript.
  • Doesn't require a transpiler.
  • Doesn't require a bundler.
  • Doesn't require NPM.
  • No external dependencies.
  • No prototype pollution.
  • No globals.
  • No slowness.

Important features:

  • Environment-independent. Runs in browsers, Deno, Node.
    • Approximate browser compatibility: evergreen, Safari 11+.
    • Node compatibility: 18+.
  • Compact and performant.
  • Relatively few source files.
  • Relatively clear source code.
  • Native JS modules. Can be imported by URL.

Alternatives that suck:

  • Using only built-ins.
  • Google Closure.
  • Deno stdlib.
  • Lodash.
  • Various other things.

TOC

Usage

Uses native JS modules, which can be imported by URL in browsers and Deno. The truly lazy can import many core modules at once:

import * as a from 'https://cdn.jsdelivr.net/npm/@mitranim/js@0.1.53/all.mjs'

Otherwise, import specific modules you need. See the list below. Example:

import * as l from 'https://cdn.jsdelivr.net/npm/@mitranim/js@0.1.53/lang.mjs'
import * as s from 'https://cdn.jsdelivr.net/npm/@mitranim/js@0.1.53/str.mjs'

Also available on NPM:

npm i -E @mitranim/js

Features

  • lang: type assertions and other essentials needed by all other code.
  • iter: tools for iteration and functional programming.
  • obj: tools for manipulating JS objects and plain dicts.
  • str: tools for manipulating strings.
  • coll: extended versions of JS data structure classes, with better APIs.
  • url: better URL implementation.
  • time: tools for datetimes and intervals.
  • http: shortcuts for the native fetch/Request/Response APIs.
  • path: various functions for working with FS paths.
  • dom: shortcuts for working with the DOM.
  • dom_shim: lightweight and performant shim for DOM nodes and elements.
  • dom_glob_shim: shimmed DOM globals, interchangeable with dom_glob_native
  • dom_glob_native: native DOM globals, interchangeable with dom_glob_shim
  • dom_reg: shortcuts for registering custom DOM elements.
  • prax: simple system for rendering DOM elements. React-inspired syntax, better semantics and performance.
  • obs: observables via proxies.
  • obs_dom: automatic reactivity for custom DOM elements.
  • cli: essential tools for CLI apps.
  • test: tools for testing and benchmarking.

Some other extremely useful features are undocumented for now. Docs are in progress.

Perf

  • Written carefully and with benchmarks.
  • Balances optimization and code compactness.
  • Tries to avoid ludicrous inefficiencies.
  • Benchmarked only in V8 for now. (Engine used in Deno / Node / Chrome.)

License

https://unlicense.org

Misc

Contact me by opening an issue or via https://mitranim.com/#contacts.

0.1.53

3 months ago

0.1.52

4 months ago

0.1.51

4 months ago

0.1.50

5 months ago

0.1.49

5 months ago

0.1.45

10 months ago

0.1.46

9 months ago

0.1.47

8 months ago

0.1.48

6 months ago

0.1.43

1 year ago

0.1.44

1 year ago

0.1.41

1 year ago

0.1.42

1 year ago

0.1.40

1 year ago

0.1.39

1 year ago

0.1.38

2 years ago

0.1.37

2 years ago

0.1.30

2 years ago

0.1.31

2 years ago

0.1.32

2 years ago

0.1.33

2 years ago

0.1.34

2 years ago

0.1.35

2 years ago

0.1.36

2 years ago

0.1.28

2 years ago

0.1.29

2 years ago

0.1.20

2 years ago

0.1.21

2 years ago

0.1.22

2 years ago

0.1.23

2 years ago

0.1.24

2 years ago

0.1.25

2 years ago

0.1.26

2 years ago

0.1.27

2 years ago

0.1.19

2 years ago

0.1.18

2 years ago

0.1.17

2 years ago

0.1.16

2 years ago

0.1.15

2 years ago

0.1.14

2 years ago