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

@ibaraki-douji/nmm

v0.0.4

Published

Manage your node modules with ease

Downloads

2

Readme

Node Modules Mover

This project allow you to use a complete other directory for your node modules. You can even use multiple directories for your node modules. Or install them in differents drives.

⚠️ This is a personnal project to help me with my own projects. Use it if you want but i will not fix errors for you ⚠️

Installation

npm install -g @ibaraki-douji/nmm

Usage

nmm [command] [options]

Options:
  --version          output the version number
  --help             display help for command

Commands:
    init                     Create a new .nmm.json file
    install [package]        Install node modules
    add [path] [--create]    Add a new path to the .nmm.json file (folder without node_modules ending) and create the folder if --create is set
    remove [index]           Remove a path from the .nmm.json file
    list                     List all paths in the .nmm.json file (with index)
    default [index]          Set a path as default (install path of the modules)

Example

npm init -y
nmm init
nmm add "D:/Deps/Nodes/Project1" --create
nmm default 2
nmm install express

After the .nmm.json file will look like this:

{
  "moduleInstallPath": "D:/Deps/Nodes/Project1",
  "modulePath": [
    "C:/Users/user/Documents/Projects/YourRealProject"
    "D:/Deps/Nodes/Project1",
  ]
}

And the index.js file will look like this:

const express = require("express");
const app = express();
app.get("/", (req, res) => {
  res.send("Hello World!");
});
app.listen(3000, () => {
  console.log("Server started on port 3000");
});

Configuration

First init your node project with npm init -y and then run nmm init to create the .nmm.json file.

After you can add paths with nmm add [path] --create and remove them with nmm remove [index].

You can list all paths with nmm list and set the default path to install the modules with nmm default [index].

You can install node modules with nmm install [package] and run your project with a normal node project node [jsFile].

.nmm.json

This file is created by the nmm init command. You can edit it manually if you want.

{
  "moduleInstallPath": "C:/Users/user/Documents/Projects/YourRealProject",
  "modulePath": [
    "C:/Users/user/Documents/Projects/YourRealProject",
    "D:/Deps/Nodes/Project1",
  ]
}
  • moduleInstallPath: The path where the modules will be installed
  • modulePath: The paths where the modules will be searched

Why ?

I have lost my drive recently so i use my NAS with a network drive to store my projects. But if the dependencies are installed on the network drive it's very slow. So i use this to install the dependencies on my local drive and use them on the network drive.

Computer
  - C: (only carry the OS and some programs like node)
  - B: (local drive)
    - Dependencies
      - NodeJS
        - Project1
        - Project2
        - DiscordBot
  - D: (network drive)
    - Dev
      - NodeJS
        - Project1
        - Project2 (using Porject2 and DiscordBot dependencies)
        - DiscordBot

Next features

  • [ ] Add a command to uninstall the modules
  • [ ] Add a command to install all modules from a module path (ex: nmm install 1 will install all modules from the path with the index 1)
  • [ ] Add a command to install all modules from all module paths
  • [ ] Add a command to update all modules from all module paths
  • [ ] Add a command to update all modules from a module path