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

web4js

v0.20.9

Published

Theos & Hyperdapp JavaScript API, middleware to talk to a theos node over RPC

Downloads

4

Readme

Hyperdapp & Theos JavaScript API

Join the chat at https://gitter.im/hyperdapp/web4.js

This is the Ethereum compatible JavaScript API which implements the Generic JSON RPC spec. It's available on npm as a node module, for Bower and component as embeddable scripts, and as a meteor.js package.

NPM version Build Status dependency status dev dependency status Coverage Status Stories in Ready

You need to run a local Ethereum node to use this library.

Documentation

Table of Contents

Installation

Node.js

npm install web4js

Yarn

yarn add web4js

Meteor.js

meteor add hyperdapp:web4js

As a Browser module

CDN

<script src="https://cdn.jsdelivr.net/gh/hyperdapp/[email protected]/dist/web4.min.js" integrity="sha256-nWBTbvxhJgjslRyuAKJHK+XcZPlCnmIAAMixz6EefVk=" crossorigin="anonymous"></script>

Bower

bower install web4js

Component

component install hyperdapp/web4.js
  • Include web4.min.js in your html file. (not required for the meteor package)

Usage

Use the web4 object directly from the global namespace:

console.log(web4); // {eth: .., shh: ...} // It's here!

Set a provider (HttpProvider):

if (typeof web4 !== 'undefined') {
  web4 = new web4(web4.currentProvider);
} else {
  // Set the provider you want from web4.providers
  web4 = new web4(new web4.providers.HttpProvider("http://localhost:8545"));
}

Set a provider (HttpProvider using HTTP Basic Authentication):

web4.setProvider(new web4.providers.HttpProvider('http://' + BasicAuthUsername + ':' + BasicAuthPassword + '@localhost:8545'));

There you go, now you can use it:

var coinbase = web4.eth.coinbase;
var balance = web4.eth.getBalance(coinbase);

You can find more examples in the example directory.

Migration from web3 to web4

web4.js is derived from web3.js of Ethereum web3 . To migrate to this framework, please follow the guide:

+Run/Connect to Theos Blockchain;
+Deploy Smart Contract;
+Install Smart Contract on Hyperdapp;

Contribute!

Requirements

  • Node.js
  • npm
# On Linux:
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
sudo apt-get install nodejs-legacy

Building (gulp)

npm run-script build

Testing (mocha)

npm test

Community

Other upcoming implementations

License

MIT © 2018 Contributors

LGPL-3.0+ © 2015 Contributors For any omissions, please contact us at [email protected]