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

npm-assistant

v1.0.4

Published

Run multiple package.json scripts from a simple GUI

Downloads

12

Readme

NPM Assistant license

Allows you to open multiple package.json, and run each of the scripts found in the package.json files by pressing buttons. Its inspired by npm-scripts-gui/screwy project, but it uses a different technology stack (logs are presented through frontail) the project uses npm-scripts-gui styles/images.

Why?

NPM (which uses package.json) has somewhat become a standard/common technology to access frontend/build assets, regardless of the technology used to serve or work with these assets (java/node/python/ruby/etc...). So its common for many server oriented projects to have a package.json, which can be used as a simple build task manager by simply defining scripts within package.json. These can execute any command on the terminal.

Yes, you can open powershell, integrated terminal, xterm, console2, etc... and run npm run ..., but running powershell/terminal/IDE instances/tabs for each script gets annoying when you are dealing with multiple projects, and is a little cumbersome (its a matter of taste). Hopefully this helps you be more efficient. It does the trick for me.

  • For Servers? Nope, this is intended for local development projects. I might gear it towards servers later.

Known issues

  • When running scripts that trigger gradlew.bat or gradle, nativeplatform from rubygrapefruit will complain about not having access to stdout, so you need to start the process on its own window. Use ctrl+click to do so.

Requirements

  • Your environmental PATH should include ./node_modules/.bin (a relative path)
  • Your environamental PATH should include a path for node and npm executables (normally that is the case already)
  • PowerShell If you are on linux/unix. You should install powershell Install Powershell On Linux
  • NodeJS You need to have an up to date version of NodeJS (6.9.2+ although 7 is not supported by edgejs)
  • [Windows] tail You need to have a tail binary (like linux tail command) available on your path (if you are using scoop, install it using scoop install coreutils)

How to Setup/Use

When using the assistant, it will automatically create an .npm-assistant directory on the root of your project (for each script stdout), use .gitignore to ignore its contents

.npm-assistant/*
!.npm-assistant/highlighter.json

Only use one npm-assistant instance, as it handles multiple projects

Setup

  • Install by running npm install -g --legacy-bundling npm-assistant (legacy-bundling is important until a build is added to this project)
  • Run npm-assistant, or from powershell start-process npm-assistant -WindowStyle hidden to have it running in the background (use -RedirectStandardError or -RedirectStandardOutput to files if desired)
  • Open browser and navigate to http://localhost:61101

Use

  • If you are using chrome you should open open the Menu -> More Tools -> Add To Desktop...
  • Add a package.json (any project)
  • Modify the base path directory of the project (the browser does not know where you loaded the package.json from)
  • Press one of the buttons (it will start the command associated with such npm script). Use ctrl while pressing to start the process on a new window (output will not be redirected to a file)
  • Press the button again to stop it
  • To see the output of one/all running processes, press the tail:std button, then press Open Viewer (important you must have ran a script button at least once to see its logs, I know... not ideal)
  • To customize the logging colors, modify .npm-assistant/highlighter.json at the package.json directory (use !.npm-assistant/highlighter.json to add it to git)
  • The browser will use localStorage to remember all packages loaded, and the server will remember the processes it has started. Basically, you can refresh the page.
  • If you make script modifications to package.json after adding it to the npm-assistant, you need to add it again to update the scripts npm-assistant knows about

Development

  • Run npm start
  • Or, run in powershell npm-assistant.ps1

TODOs

  • Test with linux
  • Google Chrome app to its always a seperate window
  • Build, so it can work with older versions of node and other browsers

Debugging

  • Open .npm-assistant directory on the directory for this project if the tail:std is not starting.
  • Use Visual Studio Code to run this project if you are having some other type of issue. Press F5.

Windows Binary Compilation (node-gyp)

  • To install some of the node_modules (websdk) you might need to install some Windows tools (only when binaries missing for latest nodejs). To install the tools, run npm install --global windows-build-tools (if you have sudo thanks to scoop, then just prefix sudo to the command, otherwise run as administrator)

  • For windows 7 or less. Install .NET 4.5

You might need to set npm config set msvs_version 2015 --global in order to not run npm install --msvs_version 2015 <package> every time