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

noracle-js

v1.0.1

Published

This repository hosts the source code for the Noracle Node.js package. This package allows you to:

Readme

noracle-js

This repository hosts the source code for the Noracle Node.js package. This package allows you to:

  • Link your domain name to your Hedera blockchain address.
  • Run an on-chain data feed by directly sending data from your website to a data feed smart contract.

How to use it

Install.

npm i noracle-js

Import.

const noracle = require('noracle-js');

Setup

Set the following two environment variables.

NORACLE_HEDERA_ADDRESS
NORACLE_HEDERA_PRIVATE_KEY

Set NORACLE_HEDERA_ADDRESS to the address that you would like to link to your domain. Set NORACLE_HEDERA_PRIVATE_KEY to the private key that corresponds to that address.

When you call noracle-js functions, it will call the blockchain from the account that corresponds to these environment variables.

Note: noracle-js submits only two kinds of transactions:

  • The transaction in which you link your domain name to your address
  • Every transaction to your domain's data feed contract (which is created when you link your domain)

Link your domain and create your data feed contract

Link your domain to your Hedera address, and create a data feed contract for your domain.

Your domain is linked to your address in a two step process:

  1. Use the private key corresponding to your domain's SSL certificate to sign a message (which, in this case, is your Hedera address).
  2. Send that message to the Noracle VerifySSLCertificate smart contract. This contract verifies that the message was indeed signed by the domain's SSL certificate. It then creates a data Feed smart contract that can only be updated by the address linked to the domain name.

All of the above is accomplished with the following noracle-js function.

linkDomainToAddressAndCreateFeed(pathToCert, pathToPrivateKey);

Where pathToCert is the path to the .pem file containing your domain's SSL certificate, and pathToPrivateKey is the path to the .pem file containing the certificate's private key.

(We assume the user generated their SSL certificate with Let's Encrypt and Certbot.)

To run your data feed, you need to create a JSON file on your server that will tell noracle-js (a) what the latest value of the data feed is and (b) what the data type of your feed is. Create this file with the following noracle-js function.

createDataFeedJsonFile(path, initialValue, dataType);

Replace path with the path to the feed's JSON file. Replace initialValue with the feed's initial value. Replace dataType with either "int", "uint", and "str".

To run your data feed, use the following function, and pass it the path to the JSON file you created earlier.

runFeed(path);

This function runs perpetually. At every block, it updates the mostRecent variable in your data Feed smart contract to match the latest value specified in the JSON file you created. You can update the latest value in the JSON file (i.e., the value that runFeed() sends to the blockchain) with the following function.

updateDataFeedJsonFile(path, value);

The value parameter must be of the type that you specified when you created the JSON file.

At every block, runFeed() sets your Feed contract's mostRecent variable to the value at latestValue in the JSON object.