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 🙏

© 2026 – Pkg Stats / Ryan Hefner

m2mpkx

v0.0.1

Published

Public Key Exchange managed via Ethereum blockchain. Designed for IoT (M2M) communication on thin(er) clients.

Downloads

13

Readme

M2Mpkx

Exchange/Registrar for public keys designed for IoT (m2m) usage. Creates a public/private key pair on the fly and publishs it to a smart contract within the Ethereum block chain. As soon as blockchain reflects transaction it allows to encrypt data for each party using the same smart contract.

Use Case

Sensor A would like to publish data to remote entity B. Both are using Contract at address 0xC

Sensor A calls:

var encrypted_data = m2mpkx.encrypt("0xC",m2m.config.fromAddress,data);

encrypted_data might be send via unsecure channel (like IPFS).

Entity B calls:

var data=m2mpkx.decrypt(encrypted_data);

Installation

  npm install M2Mpkx --save

Requirement

Requires local GETH (Go-Ethereum) node to run with RPCAPI enabled.

Sample Command Line:

	geth --rpc --rpcapi "eth,net,web3,personal" --rpcaddr "localhost"  --rpcport "8545"   

If you do not unlock an account (--unlock), you will have to provide a password in your config!

Usage

  var M2Mpkx=require("m2mpkx");
  var config = {
	path:'test\\', // If no Path is specified current directory is used to store persistent files (keys, abi,...)
    pwd:'PASSWORD', // Password to unlock account (if not done via geth call)
	rpcProvider:'http://localhost:8545' // Optional
  }
  
  // If new instance is created module checks if keys exist and if not create a new key pair
  var m2m=new M2Mpkx(config);
  
  m2m.provideContract(); // Publishs new contract to blockchain. 
  try { 
	m2m.encrypt(contract_address,to_address,data); // encrypts data for to_address to be found in contract_address 
  } catch(e) { 
    /* NOTE: We expect a throw in case our public key is not registered within the contract 
	         Module tries to publish public key and throws exception.
	*/
	console.log(e);
  }
  
  m2m.decrypt(data); // decrypts data with private key  

Contributing

Release History

  • 0.0.1 Initial release