Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

only-one

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

only-one

CLI tool for checking you have one version of a dependency in node_modules

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
222
increased by124.24%
Maintainers
1
Weekly downloads
 
Created
Source

only-one

A simple CLI tool that checks you only have one version of a dependency in your node_modules folder.

only-one react

or for multiple deps

only-one react react-dom

If none or more than one version of the deps are found the process will exit with failure. The tool works by globbing your node_modules, it has nothing to do with yarn or npm lock files and therefore checks that yarn or npm is also correctly installing into node_modules.

You may wish to add it to your test suite "test": "only-one react && mocha && eslint .".

I was motivated to build this because sometimes 3rd party libraries accidentally have react as a dependency and this can break stuff.

Please be aware if you have a large node_modules it can be quite slow because it's a lot of file paths to search through.

To install

npm install only-one --save-dev
yarn add only-one --dev

Options

--warn or -w to only warn about deps than are more than 1 and dont fail

FAQs

Package last updated on 06 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc