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

thechain

v1.0.3

Published

A simple way to integrate a blockchain in your awesome application!

Downloads

5

Readme

The Chain - A simple way to integrate a blockchain in your awesome application!

DeepScan grade

Features

  • Easy to integrate to existing apps
  • A very customizable chain
  • Custom block time
  • Block verify function
  • Local database

Incoming Features!

  • Node system - this will let you sync the chain between multiple nodes
  • Multiple extract data features
  • Block confirmation system
  • SocketIO API
  • Documentation

Tech

The chain uses a number of open source projects to work properly:

  • ExpressJS -A Web API for a simple life!
  • Progress - Flexible ascii progress bar
  • Better SQLite3 - The fastest SQLite3 library to store your precious blocks
  • MD5 - A small friend that help you to hash so much hashes
  • Helmet - The best way to secure your blockchain WEB API
  • CORS - Only here to help you with data
  • Body Parser - CORS best friend

And of course The Chain itself is open source with a public repository on GitHub.

Installation

The Chain requires Node.js v10 (only tested) to run.

Install The Chain...

$ npm install thechain --save

A simple demo

const Chain = require("thechain");
const blockchain = new Chain(path, port, blockTime); // or new Chain() for a fast blockchain

const block_one = blockchain.getBlock(1);
console.log(block_one); // this will print the genesis block

Default params:

const path = "./chain/chain.db3";
const port = 4444;
const blocktime =  60000; // 1 minute blocktime in ms

Methods

Verify the Chain

blockchain.verifyChain(); // No return

This method will be initially called to check every block, you can use it whenever you want, but warning, this method will stop your script until every block is checked.

Create new Block (WARNING! Better to set a block time and never use this method!)

blockchain.createNewBlock(); // No return

This method will create a new block when it is called, the block data will be the data contained in the data object at the block time.

Data push

const Object = ["test1", "test2"];
blockchain.push(Object); // No return

This method will push data into the block, and the block will be generated with the pushed data.

Get last 100 blocks

const last100blocks = blockchain.getLast100();
console.log(last100blocks); 

This method will return the last 100 blocks.

Get x block

const blockNumber = 2; // Block number id
const block = blockchain.getBlock(blockNumber);
console.log(block); // This will print the block data

This method will return the block with x number.

Development

PRs Welcome

Want to contribute? Great! Start by telling us your wishes!

License

The chain is licensed as MIT

Free Blockchain Software, DAM Yeah!