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

biswarup-npm

v1.0.8

Published

biswarup-npm ========= [![npm Version][NPM VERSION BADGE]][NPM PAGE] [![Node.js][NODE VERSION BADGE]][NODE PAGE] [![GitHub License][LICENSE BADGE]][LICENSE PAGE] [![CI Status][CI BADGE]][CI PAGE]

Readme

biswarup-npm

npm Version Node.js GitHub License CI Status

A lightweight and handy Node.js utility library for common tasks such as string formatting, date manipulation, object checking, sleep function, and more.


✨ Features

  • 🔧 Type and value checks (e.g., isEmpty, isObject)
  • 📆 Date formatting and parsing
  • 🧹 String manipulation
  • 🔁 Array and object utilities
  • 🪶 Lightweight with no external dependencies

Install

npm install biswarup-npm

or with yarn:

yarn add biswarup-npm

Usage

NOTE: This library exports both CJS and ESM modules.

Sleep Function (Utility)

let bn = require('biswarup-npm');

async function main() {
    console.log("Result: ", bn.helloNpm());
    await bn.sleep(10000); // time in milliseconds.
    console.log("Result: ", bn.helloNpm());
}

main();

randomInt (Utility)

let bn = require('biswarup-npm');

async function main() {
    console.log("Result: ", bn.randomInt()); // without range.
    console.log("Result: ", bn.randomInt(1,10)); //with range.
}

main();

randomFloat (Utility)

let bn = require('biswarup-npm');

async function main() {
    console.log("Result: ", bn.randomFloat()); // without range.
    console.log("Result: ", bn.randomFloat(1,10)); // with range.
}

main();

validateEmail (Utility)

let bn = require('biswarup-npm');

async function main() {
    console.log("Result: ", bn.validateEmail('[email protected]')); // Result:  true
    console.log("Result: ", bn.validateEmail('biswarup@com')); // Result:  false
}

main();

capitalize (String-Utility)

let bn = require('biswarup-npm');

async function main() {
    console.log("Result: ", bn.capitalize("hello, world!")); // Result: "Hello, World!"
}

main();

camelize (String-Utility)

let bn = require('biswarup-npm');

async function main() {
    // all output "variableClassName"
    console.log(bn.camelize("VariableClass name")); // variableClassName
    console.log(bn.camelize("Variable className")); // variableClassName
    console.log(bn.camelize("variable class name")); // variableClassName
    console.log(bn.camelize("Variable Class Name")); // variableClassName
}

main();

TypeScript (Advanced)

import readme, { type ReadmeConfig } from 'biswarup-npm';

const config: ReadmeConfig = {
    pkg: {
        name: 'my-awesome-package',
        description: 'An awesome package.',
        type: 'module',
        license: 'MIT',
        scripts: {
            test: 'jest'
        },
        engines: {
            yarn: '1.x'
        }
    },
    additionalSections: [
        {
            position: 'before:Install',
            title: 'Greetings',
            body: 'Hello world!'
        }
    ],
    badges: [
        {
            alt: 'Build Status',
            image: 'https://img.shields.io/github/actions/workflow/status/jbenner-radham/node-readme-md/ci.yaml?branch=main&logo=github&style=flat',
            link: 'https://github.com/jbenner-radham/node-readme-md/actions/workflows/ci.yaml'
        }
    ],
    licenseLink: 'LICENSE'
};

readme(config);
// > my-awesome-package
// > ==================
// > [![Build Status](https://img.shields.io/github/actions/workflow/status/jbenner-radham/node-readme-md/ci.yaml?branch=main&logo=github&style=flat)](https://github.com/jbenner-radham/node-readme-md/actions/workflows/ci.yaml)
// >
// > An awesome package.
// >
// > Greetings
// > ---------
// > Hello world!
// >
// > Install
// > -------
// > ```sh
// > yarn add my-awesome-package # Or alternatively: `npm install my-awesome-package`
// > ```
// >
// > Usage
// > -----
// > ```js
// > import myAwesomePackage from 'my-awesome-package';
// > ```
// >
// > Testing
// > -------
// > ```sh
// > yarn test # Or alternatively: `npm test`
// > ```
// >
// > License
// > -------
// > The MIT License. See the [license file](LICENSE) for details.

API

import type { PackageJson } from 'type-fest';

/**
 * Generates a readme document based upon the provided config.
 */
export default function readme(config?: ReadmeConfig): string;

export interface ReadmeConfig {
    /**
     * Additional sections to add to the readme.
     */
    additionalSections?: Section[];

    /**
     * Badges to add to the readme.
     */
    badges?: Badge[];

    /**
     * Add a hero image to the readme, below the description.
     */
    heroImage?: HeroImage;

    /**
     * While the license is derived from the `pkg.license` option this specifies
     * a link target to the license itself. If defined as `true` it will default
     * to setting the link target to "LICENSE". Please note that if
     * `pkg.license` is not defined this setting will have no effect.
     */
    licenseLink?: boolean | string;

    /**
     * The contents of a `package.json` to parse to generate the readme.
     */
    pkg?: PackageJson;

    /**
     * Whether the package should be shown as being installed as a dev
     * dependency in the "Install" section of the readme. Defaults to `false`.
     */
    preferDev?: boolean;

    /**
     * The package manager used in the "Install" and "Testing" sections defaults
     * to npm. However, this can be changed by specifying a package manager
     * (pnpm, Yarn) in `pkg.engines`. If desired set this to `true` to override
     * any package manager specified and utilize npm. Defaults to `false`.
     */
    preferNpm?: boolean;

    /**
     * Whether the example code in the "Usage" section should be terminated by
     * semicolons. Defaults to `true`.
     */
    preferSemicolons?: boolean;

    /**
     * The type of quotes used in the "Usage" section. Defaults to single
     * quotes.
     */
    quoteType?: 'double' | 'single';

    /**
     * Override any of the default generated sections.
     */
    sectionOverrides?: SectionOverrides;
}

export interface Section {
    /**
     * The position of the section in the readme. If not specified the section
     * will be appended onto the end of the readme. If a number is specified it
     * can be either positive or negative.
     */
    position?: number | PositionDirective;

    /**
     * The title of the section.
     */
    title: string;

    /**
     * The section body. If not specified it will default to the placeholder
     * text.
     */
    body?: string;
}

export interface HeroImage {
    /**
     * The image alt tag.
     */
    alt: string;

    /**
     * The image URL or path.
     */
    src: string;
}

/**
 * A `PositionDirective` is a string which begins with either "before:" or
 * "after:" and the section title to search for.
 *
 * @example
 * { position: 'after:Install' }
 * @example
 * { position: 'before:License' }
 */
export type PositionDirective = string;

export interface Badge {
    /**
     * The image alt tag.
     */
    alt: string;

    /**
     * The image URL.
     */
    image: string;

    /**
     * The link target of the image.
     */
    link: string;
}

export interface SectionOverrides {
    /**
     * Override for the "Install" section body text.
     */
    install?: string;

    /**
     * Override for the "Usage" section body text.
     */
    usage?: string;

    /**
     * Override for the "Testing" section body text.
     */
    testing?: string;

    /**
     * Override for the "License" section body text.
     */
    license?: string;
}

Testing

yarn test # Or alternatively: `npm test`

See Also

License

The MIT License. See the license file for details.