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

co2accounting

v1.0.24

Published

CO2 Accounting using CO2 Offset API

Downloads

10

Readme

co2accounting

GHG accounting and decompensation in accordance to ISO14064-(1,2,3) using CO2 Offset API

CO2OffsetNPM Version NPM DownloadsCircleCI

Installation

Use the package manager npm to install co2accounting.

from shell

npm install --g co2accounting

as a module

npm install --save co2accounting
cp sample.env .env

Edit the .env and set your RapidAPI-Key.

via source

Checkout source code from GIT and install dependencies

git clone https://github.com/energychain/co2accounting-rapidapi.git
cd co2accounting-rapidapi
npm install

Usage

Use as command line tool (CLI)

In order to script and/or include co2accounting a simple CLI-Interface is available. However, you might want to extend/modify the cli.js to fit to your particular needs.

Installation

npm install -g --save co2accounting
co2accounting -h

| Command | Description | |---------|-------------| | whoami | Gives your Account Id | | compensate [options] <grams> | Direct compensate given number grams or CO2 | | compensateEvent [options] <eventId> | Compensate remaing emission of an event | | emission [options] <grams> | Add emission to account. | | balance [options] | Retrieves CO2 Accounting Balance | | footprint [options] <searchTerm> | Searches in Footprint database | | events [options] | Retrieves emission events | | identity [options] <account> | Retrieves Nature and Details of given identity | | help [command] | display help for command | | allow <sender> <permitted> | If permitted is true the given sender is allowed to transfer co2events to this account | | transfer <event> <to> | Transfer a CO2event from this account to another account. |

Use as module (in your code)

The main usage of co2accounting is from within your code as node module. Best reference are the test cases.

const CO2Accounting = require('co2accounting');

const instance = new CO2Accounting('INSERT-RAPIDAPI-KEY');

console.log(await instance.whoami());

Try on this on RunKit.

Tests

Checkout source code first and install dependencies.

Create a .env file containing your RapidAPI Key Retrieve/Signup. If you want to use co2accounting without an RapidAPI account, you might get in contact with STROMDAO to get a precharged account.

RAPIDAPIKEY=YOURAPIKEY-GOES-HERE

Run tests

npm test

Expected Results

Results

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate. Details on contributing.

Maintainer / Imprint

Project Website: https://co2offset.io/

LICENSE

Apache-2.0