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

@zajno/common

v2.4.5

Published

Zajno's re-usable utilities for JS/TS projects

Downloads

1,568

Readme

Zajno's Toolbox

Coverage Status

This is a library with a useful utils/helpers to share across our projects.

The motivation to have this – just to control and organize some shared code that we ever wanted to write by ourselves.

Contents

Tests

Tests are written with Vitest, coverage is (kinda) tracked with Coveralls. Test coverage is mainly dictated by real-world usage in the projects.

Usage

Sources are in TypeScript, shipped as CJS & ESM modules targeted on ES2022.

Distribution

There's no barrel exports, so you can import each module separately. Each index.ts file is outlined in generated package.json's exports field. Might require tslib as a peer dependency.

The package does't really use semver for now, breaking changes to existing modules can be introduced in minor versions, so it's recommended to use ~ in your package.json's dependencies. New modules can be introduced in minor & patch versions.

Install

  1. Install from NPM:
npm i @zajno/common
  1. In your code, use each module separately:
import logger, { ILogger } from '@zajno/common/logger';

Local development (a guide to Yalc)

If you plan to update the sources while using it in your project, we'd recommend using yalc. It does some magic to allow both using it in your project and updating it.

The flow will look like the following. [1] – operations made on this project, [2] – operations made on dependant project.

  1. install yalc globally
  2. [1] fork (if you're outside Zajno) and clone this project, do npm i
  3. [1] run yalc publish --private
  4. [2] run yalc add @zajno/common && npm i
  5. [1] make changes in local copy, run tests etc.
  6. [1] run some magic: npm run publish:local – this should deliver your updated copy to local project(s) [2]
  7. [2] notice the changes in your project, repeat 5-7 until you're done
  8. [2] to cleanup, run yalc remove @zajno/common or just yalc remove --all
  9. [1] push your changes after making sure it's OK, we'd say thank you for a PR!
  10. [2] re-add the package into your project or specify tag/commit (e.g. npm upgrade @zajno/common)