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

@linkdesu/moleculejs

v1.1.1

Published

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

Downloads

29

Readme

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.