Skip to content

A boilerplate for cross platform js repo for web browsers, node and react native with a rust code

Notifications You must be signed in to change notification settings

getditto-shared/cross-platform-rust-js-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f92697d · Nov 26, 2020

History

47 Commits
Nov 5, 2020
Nov 5, 2020
Nov 22, 2020
Nov 5, 2020
Nov 5, 2020
Nov 5, 2020
Nov 22, 2020
Oct 22, 2020
Oct 30, 2020
Oct 30, 2020
Oct 30, 2020
Nov 5, 2020
Oct 27, 2020
Oct 22, 2020
Oct 27, 2020
Nov 5, 2020

Repository files navigation

Cross Platform JavaScript (TypeScript) Repo for Rust

This library shows you how to take a Rust library, compile it for WASM and as a Native Binary and use it as an NPM package with the same interface. In addition, it'll run the same Jest integration tests on all runtimes.

This simple library is a key value store that will use a different embedded key value store depending on the platform:

  • If compiling for WASM + Web Browsers, it'll use IndexedDB
  • If compiling for Native it'll use sled

Preparing

  1. Install dependencies with yarn or npm install
  2. To build rust run npm run build-core. This builds the core library in ./core
  3. To build the typescript common code run npm run build-typescript
  4. To build everything run npm run build
  5. Run tests with npm test. This runs the tests in index.spec.ts

About

A boilerplate for cross platform js repo for web browsers, node and react native with a rust code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published