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

@cantez/onyx

v1.0.5

Published

A blazingly-fast package manager for JavaScript.

Downloads

6

Readme

contributions welcome Version Open Source

Onyx is a Node.js package manager built with Go (yes, ironically) and the Cobra CLI framework. It allows you to manage your Node.js dependencies without relying on traditional package managers like npm, yarn or even pnpm. The tool provides features for installing, removing, and running scripts from package.json, with additional support for handling devDependencies.

Features

  • Install a Single Package: Install individual Node.js packages directly from the npm registry.
  • Install All Dependencies: Install all dependencies listed in package.json.
  • Install as DevDependencies: Install a package as a devDependency using a flag.
  • Remove a Package: Remove a package from node_modules and package.json.
  • Run Custom Scripts: Run custom npm scripts defined in the scripts section of package.json.
  • Install Global Packages: Install packages globally with permissions management.
  • Graceful Error Handling: Handles missing or incomplete package metadata gracefully and skips problematic packages.

Prerequisites

  • Go (>=1.20)
  • Git
  • Node (for testing and running Onyx)

Installation

  1. Clone the repository:

    git clone https://github.com/alperencantez/onyx.git
  2. Change to the project directory:

    cd onyx
  3. Build the CLI tool:

    go build -o .
  4. Move the binary to your $PATH for global usage:

    sudo mv onyx /usr/local/bin/

Now you can use onyx from any directory!

Usage

1. Install a Single Package

To install a package:

onyx get next 14.1.3

To install a package as a devDependency:

onyx get lodash --dev

2. Install All Dependencies from package.json

If you already have a package.json file, you can install all dependencies listed:

onyx deps

This command installs all dependencies and devDependencies listed in the package.json file.

3. Remove a Package

To remove a package from node_modules and package.json:

onyx remove lodash

This will delete the lodash package from your node_modules and remove its entry from the package.json file.

4. Run a Custom Script

You can run custom scripts defined in the scripts section of your package.json:

onyx r build

This will execute the build script defined in your package.json.

5. Install Global Packages

To install a package globally:

sudo onyx get lodash -g

This command installs lodash globally in your system.

Error Handling

The tool provides graceful error handling for cases such as:

  • Missing package.json.
  • Missing node_modules.
  • Packages with incomplete metadata in the npm registry.
  • Invalid or malformed versions (e.g., ^ and ~ symbols).

Logs and Warnings

In cases where a package cannot be installed due to missing metadata or other issues, warnings will be logged, but the process will continue for other packages:

Warning: 'dist' field is missing for package 'gsap'. Skipping installation.

Development

Running Locally

  1. Clone the repository:

    git clone https://github.com/alperencantez/onyx.git
  2. Make your changes.

  3. Run the project locally:

    go run main.go

Contributing

If you’d like to contribute, please fork the repository and use a feature branch. Pull requests are welcome!

  1. Fork the repo and create your branch:

    git checkout -b feature/my-feature
  2. Make changes and commit them:

    git commit -m "Add new feature"
  3. Push to the branch:

    git push origin feature/my-feature
  4. Create a PR.

License

This project is licensed under the MIT License. See the LICENSE file for details.