npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@scalar-labs/scalardl-javascript-sdk-base

v3.5.1

Published

This package is the base of Scalar DL JavaScript SDK. You probably don't really need to use this package directly. Check @scalar-labs/scalardl-web-client-sdk.

Downloads

83

Readme

CircleCI

NPM package @scalar-labs/scalardl-javascript-sdk-base is the common part for package @scalar-labs/scalardl-web-client-sdk and @scalar-labs/scalardl-node-client-sdk. Although those two packages use different gRPC tools to generate the service and the Protobuf objects, they can use @scalar-labs/scalardl-javascript-sdk-base after they inject the objects. We will introduce how to generate related static files later in this README.

relationship

The developers might not really need to use this package. Please reference @scalar-labs/scalardl-web-client-sdk or @scalar-labs/scalardl-node-client-sdk to create Scalar DLT applications.

Node version used for development and testing

This package has been developed and tested using Node LTS v14.16.0. named "fermium". This means we cannot guarantee the package nominal behaviour when using other Node versions.

How to update JavaScript-based SDKs

The files scalardl-web-client-sdk and scalardl-node-client-sdk are based on scalardl-javascript-sdk-base. So if you update the scalardl-javascript-sdk-base, you also need to update those SDKs. This following describes how to do it properly.

Use the recommended Node/Npm version for development

You can use nvm to set the recommended Node version stated in .nvmrc

nvm use

Upgrade the scalardl-javascript-sdk-base version

After modifying the implementation of scalardl-javascript-sdk-base, we have to upgrade the version field in the package.json. It looks like this:

"version": "3.0.0",

The version conforms to the rules of semantic versioning. After the package.json is upgraded with a new version, push the package to the NPM registry with npm publish.

Upgrade scalardl-javascript-sdk-base in Web and Node.js SDK

We need to update the package.json by upgrading scalardl-javascript-sdk-base. To upgrade scalardl-javascript-sdk-base, go to the root folders of scalardl-web-client-sdk and scalardl-node-client-sdk which contain the package.json file, and use this command:

npm upgrade @scalar-labs/scalardl-javascript-sdk-base

This command will update the package.json and package-lock.json files.

How to regenerate static files for scalardl-web-client-sdk

Make sure you have installed the proto buffer compiler and protoc-gen-grpc-web plugins. Then go to the folder containing scalar.proto and execute the command:

protoc --js_out=import_style=commonjs:. --grpc-web_out=import_style=commonjs,mode=grpcwebtext:. scalar.proto

Then, you will see two newly generated files scalar_grpc_web_pb.js and scalar_pb.js. Update these two files to https://github.com/scalar-labs/scalardl-web-client-sdk.

Make sure in the code that the ClientServiceBase has been initialized correctly.

How to regenerate static files for scalardl-node-client-sdk

Make sure you have installed grpc-tools (global installation recommended). Then, go to the folder containing scalar.proto and execute the command:

grpc_tools_node_protoc --js_out=import_style=commonjs,binary:. --grpc_out=grpc_js:. --plugin=protoc-gen-grpc=`which grpc_tools_node_protoc_plugin` scalar.proto

*Note: If you install grpc-tools locally, you will need to modify the above command to manually include the path of the grpc tools in the node_modules folder.

Then, you will see two newly generated files scalar_grpc_pb.js and scalar_pb.js. Update this two files to https://github.com/scalar-labs/scalardl-node-client-sdk.

Upgrade the version of scalardl-web-client-sdk and scalardl-node-client-sdk

In the same way we update the version of scalardl-javascript-sdk-base, we also use semantic versioning to update version fields in the package.json files of scalardl-web-client-sdk and scalardl-node-client-sdk, and then push them to the NPM registry with npm publish.