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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kwiz/common

v1.0.270

Published

KWIZ common utilities and helpers for M365 platform

Downloads

1,428

Readme

@kwiz/common

Shared TypeScript utilities used across KWIZ applications for Microsoft 365 and SharePoint development.

@kwiz/common provides reusable application-agnostic helpers for configuration, logging, authentication, cryptography, SharePoint REST, collections, promises, URLs, dates, types, and other common functionality.

Installation

npm install @kwiz/common

Requirements

  • Node.js 16+

The published package targets ES2019 and supports both ES modules and CommonJS.

Application Configuration

Applications that use configuration-dependent functionality or shared logging should initialize @kwiz/common before those APIs are used.

import { config } from "@kwiz/common";

export const { GetLogger, configInfo } = config({
    BuildNumber,
    ReleaseStatus,
    ProjectName: "[my-project]"
});

Configuration Parameters

| Property | Type | Purpose | | --- | --- | --- | | BuildNumber | string | Identifies the current consuming application build. | | ReleaseStatus | "dev" \| "fastring" \| "production" \| "npm" | Identifies the runtime/release environment. | | ProjectName | string | Prefix used to identify the consuming application in shared logging. |

Environment flags are derived automatically from ReleaseStatus; they are not passed to config().

configInfo.IsLocalDev;
configInfo.IsFastRing;
configInfo.IsProduction;

The current mapping is:

| ReleaseStatus | IsLocalDev | IsFastRing | IsProduction | | --- | ---: | ---: | ---: | | "dev" | true | false | false | | "fastring" | false | true | false | | "production" | false | false | true | | "npm" | false | false | true |

Logging

The recommended way to obtain a logger is from the result of config():

import { GetLogger } from "./initCommon";

const logger = GetLogger("MyService");

logger.debug("debug message");
logger.info("information message");
logger.warn("warning message");
logger.error("error message");

config() also returns configInfo, which contains the normalized shared configuration.

The legacy logger(name) return value is deprecated; use GetLogger(name) instead.

Applications with Multiple Entry Points

If an application produces multiple independently loaded bundles, each entry point must ensure configuration has occurred before configuration-dependent code runs.

A shared bootstrap module is recommended:

// initCommon.ts
import { config } from "@kwiz/common";

export const { GetLogger, configInfo } = config({
    BuildNumber,
    ReleaseStatus,
    ProjectName: "[my-project]"
});

Then import it from each independently loaded entry point:

import "./initCommon";

If the bootstrap module is imported only for its side effect, make sure the consuming bundler does not remove it during tree shaking. For example:

{
    "sideEffects": [
        "./src/initCommon.ts"
    ]
}

Alternatively, expose an explicit initialization function and call it from each entry point.

Public Entry Points

The package currently exposes these supported entry points:

@kwiz/common
@kwiz/common/auth
@kwiz/common/crypto
@kwiz/common/sharepoint-rest

Root

Use the root package for general shared helpers, types, configuration, logging, and other common utilities:

import {
    config,
    CommonLogger,
    normalizeUrl,
    jsonParse,
    promiseAllSequential
} from "@kwiz/common";

The root entry point uses static exports so modern bundlers can remove unused modules.

Authentication

import {
    AutoDiscoverTenantInfo
} from "@kwiz/common/auth";

Cryptography

import {
    sign
} from "@kwiz/common/crypto";

SharePoint REST

import {
    GetList
} from "@kwiz/common/sharepoint-rest";

Use focused entry points for heavier functionality when possible. This keeps dependencies explicit and gives consuming bundlers a cleaner module graph.

Tree Shaking

@kwiz/common is published as both ESM and CommonJS and includes sideEffects metadata for modules that must be preserved.

For the best tree-shaking results:

  • Prefer ESM in modern bundlers.
  • Import only the functionality your application needs.
  • Use focused package entry points for auth, crypto, and SharePoint REST functionality.
  • Avoid importing unrelated modules solely for side effects.

Package Output

The package publishes:

lib/
    esm/      ES module output
    cjs/      CommonJS output
    types/    TypeScript declarations

The root package resolves to:

ESM:        lib/esm/index.js
CommonJS:   lib/cjs/index.js
Types:      lib/types/index.d.ts

Development

For repository setup, build requirements, testing, export conventions, tree-shaking guidance, and release practices, see development.md.

Repository

Source: SnapOn-Software/common

Issues can be reported through the GitHub repository.

License

This project is licensed under the MIT License.

Copyright (c) 2024 KWIZ Corp.