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

npm2yarn

v1.0.0

Published

A command-line tool for converting projects that use `npm`, [`npm-shrinkwrap`](https://www.npmjs.com/package/npm-shrinkwrap) (Uber's package for shrinkwrapping), and/or [`npm-shrinkwrap-check`](https://www.npmjs.com/package/npm-shrinkwrap-check) to Yarn.

Downloads

100

Readme

npm2yarn

A command-line tool for converting projects that use npm, npm-shrinkwrap (Uber's package for shrinkwrapping), and/or npm-shrinkwrap-check to Yarn.

npm2yarn was open-sourced as part of our Yarn-ifying Mixmax blog post, which goes into detail about why we decided to move to Yarn, how we did it, and what we learned along the way.

We created npm2yarn to ensure that we updated our projects correctly throughout our 75-project sweep of Yarnification.

Procedure

npm2yarn:

  1. Checks out the master branch
  2. Pulls the latest changes
  3. Checks out a new branch, yarnify, overwriting any existing yarnify branch
  4. Removes npm-shrinkwrap.json if it exists
  5. Uninstalls npm-shrinkwrap if it exists, updating package.json
  6. Uninstalls npm-shrinkwrap-check if it exists, updating package.json
  7. Removes node_modules to avoid any installation conflicts
  8. Installs your project dependencies using Yarn, generating a yarn.lock file
  9. Runs yarn check to ensure that your dependencies were installed correctly (check out our blog post if you encounter any issues in this step)
  10. Runs yarn test as a sanity check
  11. Stages the changes made
  12. Logs a list of manual steps to be taken to complete the transition

This conversion will likely involve the upgrading of some/many of your transitive dependencies, so make sure to test thoroughly! :)

Installation

$ yarn global add npm2yarn

or

$ npm install -g npm2yarn

Usage

(in the directory of the project to convert, which must be a Git repository)

$ npm2yarn

Troubleshooting

Check out our Yarn-ifying Mixmax blog post for details on the issues we came across while transitioning to Yarn and how we solved them.

If you're having trouble with the script, please file an issue and we'll check it out!

Contributing

We welcome your pull requests! Please lint your code.

Changelog

  • 1.0.0 Add initial code