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 🙏

© 2025 – Pkg Stats / Ryan Hefner

jsvcn

v2.2.3

Published

CodeNotary JS Client

Readme

jsvcn

CodeNotary - JavaScript Client

Global, de-centralized signing of code and other digital assets.

This package provides an easy to use javascript client for the CodeNotary platform.

Features:

  • authenticate digital assets via Codenotary API or Codenotary Blockchain
  • notarize, untrust and unsupport digital assets via Codenotary API

Demo

Install:

npm install jsvcn

Init

ES6:


import Jsvcn from "jsvcn"

const jsvcn = new Jsvcn();

ES5 (bundled):

<script src="https://unpkg.com/[email protected]/dist/jsvcn.min.js" type="text/javascript"></script>

var jsvcn = new Jsvcn();

Configuration

Configure the client via passing a configuration object to the constructor:


const config = {
	credentials: {
		email: '[email protected]',
		password: 'abc123',
	},
	mode: 'blockchain',
	...
}

const jsvcn = new Jsvcn(config);

List of configuration options

| Configuration | Descrition | | --- | --- | | credentials | Credentials for notarization | | mode | Default value: 'api' - Switch between 'api and 'blockchain' mode | | checksums | Default value: ['sha256'] You can add more hash algorithms to get the hashed file's checksums. |  | validationOnly | Default: false. Blockchain mode only. Set it to true in case you don't want to query asset details from the CodeNotary Asset Server (faster response) | | apiUrl | Custom CodeNotary API url - overwrite this if you use local vcn api | | blockchainUrl | CodeNotary Blockchain url - overwrite this if you want to use staging | | assetUrl | CodeNotary Asset Server url - overwrite this if you want to use staging | | blockchainAssetAddress |  Custom Contract address - for staging | | blockchainOrganizationAddress |  Custom Org. Contract address - for staging |

Every configuration option is optional.

Authentication

jsvcn.verify(file).then((response) => {
 ...
})

More information about the response format: [#] (CodeNotary API Documentation])

Authentication with Organization

jsvcn.verify(file, progressCb, "myorg.com").then((response) => {
 ...
})

Authentication with SignerIDs

jsvcn.verify(file, null, ['id1','id2',...]).then((response) => {
 ...
})

Notarization

jsvcn.sign(file).then((response) => {
 ...
})

For notarization you need to pass valid CodeNotary user credentials in the config:


const jsvcn = new Jsvcn({
	credentials: {
		email: '[email protected]',
		password: 'abc123',
		// notarizationPassword: 'abc321' - required only when your notarization password is different than your normal user password. 
	},
	...
);

Public Notarization

jsvcn.sign(file, { public: true }).then((response) => {
 ...
})

More information about the response format: [#] (CodeNotary API Documentation])

Untrust / Unsupport

In case you want to unsupport/untrust an asset of yours that you no longer have, you can do that exactly the same way like signing one:


jsvcn.untrust(<file or hash>).then((response) => { ...

FAQ:

Authenticate / notarize sha256 hashes

Verify and sign are able to authenticate / notarize directly the SHA256 hash of an asset:


jsvcn.verify("32c6a50aba0b30f63f124f4b2bb47dc027b9e48f838f71d1debe69d8680ecf70");

Async - await syntax

Verify and sign methods are always returning with a Promise. If you prefer async-await syntax you can use that as well:


async function myAuthenticate(){
 const {status} = await jsvcn.verify(FILE);
 ...
}

Progress callback (for large files)

Since veriy and sign methods are asyncronous calls it's easy to implement progress indicators (eg. just toggle a variable before and after the call.) But for verify and sign commands we are also providing a progress callback as second parameter which periodically returns with the exact percentage of the file hashing progress. This is really handy when you verify large files and want to display (the real) status of the progress.

jsvcn.sign(file, (progress) => console.log(progress + '%'));

Calculate Checksums

CodeNotary.io uses SHA256 algorithm to calculate and compare file hashes, but our library can also provide SHA1, SHA512, MD5 checksums of the file. You can add "checksums" attribute to the config object with an array of checksums you want to get back from the verify method.

const jsvcn = new Jsvcn({checksums: ["sha1", "md5"]});

Authentication directly via the CodeNotary Blockchain with Ethers.js

If you want to directly authenticate assets with CodeNotary Blockchain add this to your html page:

<script src="https://cdn.ethers.io/scripts/ethers-v4.min.js" type="text/javascript"></script>

and set mode: 'blockchain', in your config.

License

This software is released under GPL3.