Earthstar Streaming RPC
This is a "Deno-first" package -- it's written for Deno, and then also converted and published to npm. It should also work from browsers -- typically you'd import it from your own separate npm project and use a bundler such as webpack to put everything together.
To use in Deno, add the following:
import * as RPC from "https://TODO.com/earthstar-streaming-rpc/mod.ts";
To use with Node or apps built with NPM dependencies:
npm i earthstar-streaming-rpc
And then import in your code:
import * as RPC from "earthstar-streaming-rpc";
You will need Deno installed. Instructions for installation can be found here. You may also want type-checking and linting from Deno for your IDE, which you can get with extensions like this one for VSCode.
To check that you've got everything set up correctly:
This will run the example script at
example-app.ts, and you will see a lot of colourful log messages from the app.
Scripts are run with the
make test- Run all tests
make test-watch- Run all tests in watch mode
make fmt- Format all code in the codebase
make npm- Create a NPM package in
npmand run tests against it (requires Node v14 or v16 to be installed).
make bundle- Create a bundled browser script at
make depchart- Regenerate the dependency chart images
make coverage- Generate code test coverage statistics
make clean- Delete generated files
- The entry for the package can be found at
- Most external dependencies can be found in
deps.ts. All other files import external dependencies from this file.
- Script definitions can be found in
- Tests are all in
- The script for building the NPM package can be found in
Publishing to NPM
make VERSION="version.number.here" npm, where
version.number.hereis the desired version number for the package.