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

nubitools

v1.3.0

Published

Node utilities

Downloads

13

Readme

Nubitools

Node utilities.

Reusable utility functions for my Node.js projects — and maybe yours too.

license
npm version
Dependencies

Project Goals

  • Dogfood first – Only add features actively used in real-world projects.

  • Simplicity – Focus on small, composable functions that solve practical problems.

  • Modular – Organized by domain (e.g., file system, git, CLI).

  • No TypeScript – Plain JavaScript for fast prototyping and hacking.

  • MIT Licensed – Made for personal use, but open to everyone.

Out of Scope

  • No browser or frontend utilities

  • No TypeScript support or type annotations

  • Not dependency-free (uses practical packages like inquirer)

Installation

npm install nubitools

Usage

gitSparseClone(repoUrl, sparsePaths, targetDir)

Clones a Git repository using sparse checkout, so only the specified files or directories are checked out.
This is useful to save bandwidth and disk space when you only need parts of a large repo.

  • repoUrl: URL of the Git repository to clone.
  • sparsePaths: Array of paths (files or directories) to include in the sparse checkout.
  • targetDir: Directory where the repository will be cloned.

Throws an error if any git command fails during the cloning or sparse checkout process.

Example:

import { gitSparseClone } from 'nubitools'

const repoUrl = 'https://github.com/octocat/Hello-World.git'
const sparsePaths = ['README.md', 'docs/']
const targetDir = '/tmp/hello-world'

try {
    gitSparseClone(repoUrl, sparsePaths, targetDir)
    console.log('Repository cloned with sparse checkout!')
} catch (err) {
    console.error('Failed to clone repository:', err.message)
}

promptInput(message, validate?)

Prompt the user for input in the terminal using Inquirer.js, with optional input validation.

Example:

import { promptInput } from 'nubitools'

async function main() {
    const name = await promptInput(
        'What is your name?',
        (input) => input.trim().length > 0 || 'Name cannot be empty',
    )
    console.log(`Hello, ${name}!`)
}

main()

readJsonFile(filePath)

Reads and parses a JSON file from the given path.

  • Throws if the file does not exist.
  • Throws if the JSON is invalid.
import { readJsonFile } from 'nubitools'

const config = readJsonFile('./config.json')
console.log(config.setting)

Contributing

Want to contribute? All contributions are welcome. Read the contributing guide.

Questions

If you have questions tweet me at @sandro_m_m or open an issue.

License

This project is licensed under the MIT License - see the LICENSE file for details

~ sharing is caring ~