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

z-helper

v1.0.9

Published

A collection of libraries that I use in a lot of projects, feel free to modify them for your use.

Downloads

26

Readme

ZHelper

Build Status Codacy Badge Greenkeeper badge

A collection of libraries that I use in a lot of projects, feel free to modify them for your use.

I realised that in a lot of projects I do, there are a few things that I almost always write from scratch, that's why I decided to create this.

This module is under the MIT license - see the LICENSE file.

To test the module, run

npm test

Installation

To install run

npm i --save-dev z-helper

Usage

To require everything, use

const zHelper = require('z-helper')

Data Store

There are two ways to use my data store, you can use it as a local store that will only be persistent in the file it is initialised in.

const dataStore = require('z-helper').dataStore

Or you can use it as a global data store across your whole application.

const dataStore = new require('z-helper').dataStore.Instance()

You can also use both throughout the app if you would like.

The following functions are exposed and work the same for local and global data store.

set

dataStore.set('nameOfValueToStore', {'object': 'containing data'})

The set function can store anyhting you can think of from promises to functions to objects.

The set function returns the dataStore instance so you can chain functions.

dataStore.set('nameOfValueToStore', {'object': 'containing data'})
  .get('nameOfValueOfValueToStore')

get

console.dir(dataStore.get('nameOfValueToGet'))

The get function returns whatever was stored under the key given to it, if that key does not exist, it simply returns null.

Google Analytics

Google analytics is a work in progress

Test coverage and eslint

Data Store has property ✓ Instance ✓ get ✓ set Instance has property ✓ get ✓ set stores ✓ an object ✓ an arrow function ✓ a function ✓ a string ✓ an integer ✓ a boolean global store has property ✓ get ✓ set stores ✓ an object ✓ an arrow function ✓ a function ✓ a string ✓ an integer ✓ a boolean

Google Analytics has a global instance ✓ that has the setOption property ✓ that has the setAction property ✓ that has the getOptions property ✓ that has the getActions property and add a new ✓ option ✓ action can create a local instance ✓ that has the setOption property ✓ that has the setAction property ✓ that has the getOptions property ✓ that has the getActions property and add a new ✓ option ✓ action sends - a screenview - an event

31 passing (12ms) 2 pending

---------------------|----------|----------|----------|----------|----------------| File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | ---------------------|----------|----------|----------|----------|----------------| All files | 52.27 | 40.91 | 37.5 | 52.27 | | ZHelper | 100 | 100 | 100 | 100 | | main.js | 100 | 100 | 100 | 100 | | ZHelper/src | 51.72 | 40.91 | 37.5 | 51.72 | | dataStore.js | 100 | 50 | 100 | 100 | 7 | googleAnalytics.js | 45.45 | 40 | 28.57 | 45.45 |... 164,166,167 | ---------------------|----------|----------|----------|----------|----------------|