https://github.com/vitalics/rslike
Rust-like but for TypeScript/JavaScript
https://github.com/vitalics/rslike
javascript option result try-catch typescript undefined undefined-behavior
Last synced: 2 months ago
JSON representation
Rust-like but for TypeScript/JavaScript
- Host: GitHub
- URL: https://github.com/vitalics/rslike
- Owner: vitalics
- License: other
- Created: 2023-08-04T08:46:37.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-10T14:49:23.000Z (about 1 year ago)
- Last Synced: 2024-05-10T19:42:43.341Z (about 1 year ago)
- Topics: javascript, option, result, try-catch, typescript, undefined, undefined-behavior
- Language: TypeScript
- Homepage: https://www.npmjs.com/search?q=%40rslike
- Size: 174 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README


# Rust Like
Make Javascript without undefined behavior. Forget about `try/catch/finally`
## Reason to use rslike
1. Less undefined behavior, when using `Option` and `Result`.
2. Well tested. `100% test coverage`
3. JSDoc with examples.
4. Typescript ready - d.ts types are generated with tsc.
5. first-class `CJS` and `ESM` support.
6. Zero dependencies.
7. `2kB` for min+gzip and `7.6kB` for minified. See in [bundlefobia](https://bundlephobia.com/package/@rslike/[email protected]).
8. Deno?## Wanna be contributor?
See [contribute guide](./CONTRIBUTING.md)
## Wiki
Available by link: https://github.com/vitalics/rslike/wiki
## Packages
- [std](./packages/std/README.md). Standard library. Includes `Result`, `Option`, `match`, `Bind`, `Async`.
- [cmp](./packages/cmp/README.md). Comparison package. Exporting `Ordering` class and `Eq`, `PartialEq`, `Ord`, `PartialOrd` types.
- [dbg](./packages/dbg/README.md). Prints debug information about given variable.## Tech Stack
- [pnpm](https://pnpm.io)
- [tsup](https://tsup.egoist.dev/)
- [typescript](https://www.typescriptlang.org/)
- [changeset](https://github.com/changesets/changesets)
- [husky](https://www.npmjs.com/package/husky)
- [github actions](https://github.com/features/actions)
- [jest](https://jestjs.io/)
- [eslint](https://eslint.org/)## Plans
- [] Primitives
- [] extendign built-ins collections
- [] Extend Collections (Hashset, Hashmap, MapReduce)
- [] make `match` tc39 proposal compatable.