Code Monkey home page Code Monkey logo

remove-lockfiles's Introduction

remove-lockfiles

Prevent committing lockfiles

Package Version Downloads Status Build Status: Linux Build Status: Windows Coverage Status

Why

Installation

npm install --save-dev remove-lockfiles

Usage

Pre-commit hook

Install husky:

npm install husky --save-dev

Edit package.json to include this configuration:

{
  "scripts": {
    "precommit": "remove-lockfiles"
  }
}

Looking for alternative to husky? We can also use remove-lockfiles with pre-commit.

CLI

Install remove-lockfiles globally:

npm install --global remove-lockfiles

Run the script:

$ remove-lockfiles --help

  Usage
    $ remove-lockfiles [path|options]

  Options
    --shrinkwrap  Remove `npm-shrinkwrap.json` if found

  Examples
    $ remove-lockfiles
    $ remove-lockfiles ../foo
    $ remove-lockfiles --shrinkwrap
    $ remove-lockfiles --shrinkwrap ../foo

API

removeLockfiles([options])

Returns Promise<Array> of deleted lockfiles.

options

Type: Object

cwd

Type: string
Default: process.cwd()

Current working directory.

shrinkwrap

Type: boolean
Default: false

Set to true to remove npm-shrinkwrap.json.

Related

  • del-nm-cli - Delete node_modules and lockfiles
  • force-del - Force delete files or folders using glob patterns
  • has-lockfile - Detect lockfiles in the working directory

License

MIT © Lufty Wiranda

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.