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

simple-graphite-client

v0.2.8

Published

Typescript compatible library to send data to a Graphite metrics server.

Downloads

31

Readme

simple-graphite-client

npm Tests License: MIT

This is a compact TypeScript library designed for transmitting data to a Graphite metrics server (Carbon). It draws significant inspiration from graphyte, a Python library. Currently, this library is simpler in comparison, as additional complexity wasn't required at this stage.

npm install simple-graphite-client

Usage

You first have to define the Graphite client:

import  Sender  from "simple-graphite-client";

const client = new Sender({
     host: "http://graphite.example.org"
});
await client.send({
    metric: "foo.bar",
    value: 42
});

If you want to send tagged metrics, the usage is as follows:

await client.send({
    metric: "foo.bar",
    value: 42,
    tags: {"ding": "dong"}
});

If you want to send via UDP instead of TCP, just change protocol:'udp' to Sender() call.

License

Licensed under the MIT license.

Development

NVM - Node Version Manager

I recommend you to use nvm to download the current version of node.js used on the project.

To download the nvm run the follow command:

You can look for more information on the nvm repository

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

Once you have installed nvm and it's working, you can run the follow to install the correct version of node.js:

Make sure you are on the current path of the project, where the .nvmrc file is located

nvm install
nvm use

Installing packages

Once you have installed the current version of Node.js, NPM you can do it running the follow:

Make sure you are using the current context of Node.js and NPM.

npm install

Test Dependencies

To run the tests you'll need to have tcp-receiver running on port 9950 and 9528. To do that, run:

docker run -d -p 9950:9950 -p 9528:9528 cameritelabs/tcp-receiver:latest

Once you have the container running you can run:

# to run the tests
npm run test

# to run the tests and generate coverage report
npm run coverage