Skip to content

cohort_sdk_js 0.2.15

Install from the command line:
Learn more about npm packages
$ npm install @kindredgroup/cohort_sdk_js@0.2.15
Install via package.json:
"@kindredgroup/cohort_sdk_js": "0.2.15"

About this version

The internal JavaScript binding for Cohort SDK

The "cohort_sdk_js" module is a bridge between Rust and JavaScript utilising Node-API - an API for building native Addons. In our case the addon is written in Rust. So, the actual Talos Cohort SDK can be found in packages/cohort_sdk package. The cohort_sdk_js should be considered an internal project as it is not designed to be consumed directly by JS apps. Applications should use cohort_sdk_client.

When publishing it is being packaged as incomplete NPM module and published to GitHub Packages NPM repository. Currently, the packaging process is bundling together Rust source code of ../packages/cohort_sdk implementation along with its project-level dependencies.

The content of NPM module published to repository is missing index.js, index.d.ts and native library with SDK implementation. All these missig files are generated by NAPI-RS during package install time.

When cohort_sdk_js NPM package is installed via npm -i the "postinstall" hook is invoking cohort_sdk_js/scripts/postinstall.sh which in turn compiles Rust code for your architecture, then generates JS code and moves files to their indended destinations so that we end up with finished working NPM package. All this happens on the client machine under ./node_modules/@kindredgroup/cohort_sdk_js. The build process is verbose if installation is invoked with additional flag: npm -i @kindredgroup/cohort_sdk_js@SOME_VERSION --foreground-scripts, otherwise native compilation happens in the background.

As such, for prerequisites of installing this package we require that Rust development environment is setup on the user machine.

The procedure is explained in the ../cohort_sdk_client read me.

Details


Assets

  • cohort_sdk_js-0.2.15.tgz

Download activity

  • Total downloads 98
  • Last 30 days 0
  • Last week 0
  • Today 0