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

yarn-no-save

v1.1.3

Published

Enabling --no-save/-N option to Yarn cli commands

Downloads

43

Readme

yarn-no-save

Enabling --no-save / -N option to Yarn cli commands. The option prevents saving to package.json when you do yarn add stuff.

How to Use

Basicly

  1. First you should have yarn installed globally. See more at the official site

  2. install yarn-no-save globally:

    $ yarn global add yarn-no-save
  3. Now you can use Yarn with --no-save / -N option in your command:

    $ yarn add --no-save xxxxxxxx

Advanced

Firstly, let's see how it works. Basically, we are making a feature injection to Yarn:

  • before saving to the root manifest (package.json), we try to stop the saving operation if --no-save / -N option is given.

  • to prevent yarn to throw an exception when we are trying to remove packages which are not found in the manifest file (package.json).

  • to update the help message.

Also, the "feature injection" will fail if Yarn in updated or reinstalled, so we need to check if any changes (including file replacement) are made to the file. Therefore, we build a watcher to surveil the changes. In order to ease you up, we register it as a system service at startup. So there is nothing more to do when you reinstall Yarn by default.

In advance, we offered you someway to control the service. Here are the advanced usages (These commands are ONLY available for MacOS):

  1. Stop watching and reset Yarn to default:

    $ yns reset

    This will reinstall Yarn from your current registry. If you want --no-save / -N option back, you should run the following commands:

    $ yns
    $ yns start
  2. Start watching service:

    $ yns start
  3. Stop watching service:

    $ yns stop
  4. Reload watching service:

    This doesn't unload watching configs, just reloads the service (quick reload).

    $ yns reload
  5. Restart watching service:

    This unloads watching configs and starts from the beginning (full restart).

    $ yns restart
  6. Check if --no-save / -N option is available:

    $ yns check

    or

    $ yns validate

To Mention

  1. The --no-save / -N option will be available in help message by typing "yarn help add" or "yarn add --help".

  2. You are free to uninstall any packages installed with --no-save / -N option by executing "yarn uninstall xxxxx" (postuninstall scripts will be executed by doing this, while the same thing won't happen by just deleting the folders from node_modules).

  3. Please contact me if you have any problems into this tool.

Author

@shuangwhywhy