Socket
Book a DemoInstallSign in
Socket

@linkdesu/moleculejs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@linkdesu/moleculejs

A typescript implementation for @nervosnetwork/molecule which is a compiler for serializing structured binary data on a blockchain named CKB.

1.1.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

moleculejs

License License

This is command line tool for serializing structured binary data. It is implemented via typescript with a prebuilt moleculec as dependency. moleculec is an official compiler for molecule schema, its repository is @nervosnetwork/molecule. You may get the detailed encoding spec in there.

Installation

The recommended way is installing as global package, then you may use the command moleculejs wherever you want.

npm i -g @linkdesu/moleculejs

After package installed, you need to download moleculec manually, with the following command:

moleculejs -d

⚠️ Download prebuilt from untrusted source is really dangerous, so I also provide a option to download from a custom source:

moleculejs -d --download-from https://url_to_a_prebuilt_moleculec

Usage

  • First, write molecule schema files with .mol suffix.
  • Then, select a directory to store output typescript files.

Now, you could start compiling with the following commands:

moleculejs -i <path_of_schema_inputs> -f <path_of_ts_outputs>

For more options please try moleculejs -h .

Typescript Keywords

Here we have a simple convention which the name of types must be PascalCase, so moleculejs will not rename any of type's name. But if any field of struct or table conflict with typescript keywords, then moleculejs will add a underline at the end of it.

For example: new will be rename to new_ .

TODO

  • Add github workflow as ci process.
  • Implement unit tests from nervosnetwork/molecule.
  • Support customizable eslint configs.
  • Improve console messages for a better experience.
  • Support Union data type.

Keywords

molecule

FAQs

Package last updated on 26 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.