GithubHelp home page GithubHelp logo

susisu / npm-safety-updater Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pastak/npm-safety-updater

0.0 1.0 0.0 39 KB

This is utility tool for updating npm modules safety.

Home Page: https://www.npmjs.com/package/npm-safety-updater

License: MIT License

JavaScript 100.00%

npm-safety-updater's Introduction

npm-safety-updater

This is utility tool for updating npm modules safety.

What is it solution for

Updating npm modules is important but it is hard to confirm this update won't break application even if we have unit test and E2E test.

This will execute test commands on each update then if it fails, this will rollback package.json and lockfile.

This makes your updating npm module more safety.

Usage

Usage
  $ safety-update ['major'|'minor'|'patch'|'all']

Options
  --config, Config file path
  --only-prod, Update Only dependency
  --only-dev, Update Only devDependency
  --break, -B, Update include breaking changes
  --force, Skip test command on update
  --manager <'npm'|'yarn'>, Detect your module manager.

Examples
  $ safety-update minor patch --only-dev

for more infomation: https://github.com/pastak/npm-safety-updater
  1. echo '{}' > safety-update.config.json on Project root.
  2. npx npm-safety-updater patch --only-dev

⚠️ Caution

Don't use it via project's node_modules , use via npx or global install because this command remove project's node_modules directory to refresh dependency (also npm ci includes removing node_modules).

Config

{
  "packageFilePath": "path/to/package.json",
  "prepare": ["npm run build"],
  "testCommand": ["echo 'no test'", "exit 1"],
  "afterTest": "echo 'after test'",
  "onlyFailed": "echo 'test failed'",
  "onlySuccess": "echo 'test success'"
}
  • packageFilePath: string: Specify package.json path
  • prepare: string | string[]: commands execused before updating a module
  • testCommand: string | string[]: commands for test after updating a module
  • afterTest: string | string[]: commands execused after test commands
  • onlyFailed: string | string[]: commands execused when fails test commands
  • onlySuccess: string | string[]: commands execused when success test commands

Replacable synbols in commands

  • %PACKAGE_NAME%
  • %CURRENT_VERSION%
  • %GOTO_VERSION%
  • %DEPS_TYPE%

TODO

  • test

npm-safety-updater's People

Contributors

pastak avatar susisu avatar windymelt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.