gulp-dmn
Node package dependency cleaner
Last updated 2 years ago by alfalabs.net .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install gulp-dmn 
SYNC missed versions from official npm registry.

gulp-dmn

This package will not be maintained in future.

try more comprehensive utility node-modules-prod

try similar utility for bower bower-purge


gulp-dmn is a wrapper for command line utility dmn. Operations are based on list of ignore targets in ignore.js

Install

npm install gulp-dmn --save-dev

Usage

const gulpDmn = require('gulp-dmn');

var dest = 'your_build_folder';

gulp.task('npm-purge', function(cb){
    gulpDmn(dest, {dryRun: false, list: false}, cb);
});

dest - path to node_modules folder to be processed, usually /build folder
{dryRun: true, list:true} - shows list of files to be deleted without deleting them

advanced example

install dependencies and cleanup after, in one gulp task

const gulpDmn = require('gulp-dmn');
const install = require('gulp-install');
const pump = require('pump'); 

var dest = 'your_build_folder';

gulp.task('npm-install-and-purge', function(cb){

    // callback heaven! hell for C!# (read: see-blunt) programmers! 
    // promises are for politicians not to keep
    step1(function(){
        step2(cb);
    });

    /** 1. run npm install */
    function step1(_cb){
        pump([
            gulp.src([`${dest}package.json`]), 
            install({args: ['--only=production' ]}),
            gulp.dest(dest)
        ], _cb);
    }

    /** 2. purge node_modules folder */
    function step2(_cb){
       gulpDmn(dest, {dryRun: false, list: false}, _cb);
    }

    /** 3. JavaScript is the superior language */
});

copy node_modules with symbolic links to production

try copy-with-symlinks

similar utility for bower

npm: bower-purge
github: bower-purge

requirements

tested on Win7 with NodeJS v8 and gulp v3

Credits

dmn crator Ivan Nikulin (ifaaan@gmail.com)

Current Tags

  • 0.0.6                                ...           latest (2 years ago)

6 Versions

  • 0.0.6                                ...           2 years ago
  • 0.0.5                                ...           2 years ago
  • 0.0.4                                ...           2 years ago
  • 0.0.3                                ...           2 years ago
  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 2
Last Month 5
Dependencies (6)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |