Giter Club home page Giter Club logo

Comments (10)

kevva avatar kevva commented on August 25, 2024
"scripts": {
    "clean": "node_modules/.bin/del dist/*"
}

from del.

sparty02 avatar sparty02 commented on August 25, 2024

@kevva That doesn't work. "node_modules/.bin/del" doesn't exist on a local del install.

from del.

kevva avatar kevva commented on August 25, 2024

On a local install it should definitely exist. On a global install it doesn't though.

nvm, this doesn't have a CLI so no wonder it doesn't work for you. Use trash if you need CLI functionality. This module only works when required as seen in the usage instructions.

from del.

sparty02 avatar sparty02 commented on August 25, 2024

@kevva I just created a new module. Ran:

npm install del

There is no node_modules/.bin/del directory! There is a node_modules\del\node_modules\.bin directory which, ironically, has rimraf in it.

from del.

sparty02 avatar sparty02 commented on August 25, 2024

As a matter of fact, it looks like even a global install of del (on Windows) doesn't attempt to alias del! Not sure why this issue was closed so quick.

_global rimraf install:_

PS C:\Users\e1031513\dev\projects\temp> npm install -g rimraf
C:\Users\e1031513\AppData\Roaming\npm\rimraf -> C:\Users\e1031513\AppData\Roaming\npm\node_modules\rimraf\bin.js
[email protected] C:\Users\e1031513\AppData\Roaming\npm\node_modules\rimraf
└── [email protected] ([email protected], [email protected], [email protected], [email protected])

_global del install:_

PS C:\Users\e1031513\dev\projects\temp> npm install -g del
[email protected] C:\Users\e1031513\AppData\Roaming\npm\node_modules\del
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected])

from del.

kevva avatar kevva commented on August 25, 2024

There is no node_modules/.bin/del directory!

Because it doesn't have a CLI.

As a matter of fact, it looks like even a global install of del (on Windows) doesn't attempt to alias del!

Why would it?

from del.

sparty02 avatar sparty02 commented on August 25, 2024

I don't really care that much about the lack of a global install (although rimraf does support one and this module appears to be a superset improvement of rimraf). What I originally wanted to do was just simply use this in a simple npm "clean" script task. I was previously using rm -rf in the task, but that's doesn't have cross platform support without something like cygwin or winbash or something.

Not a huge deal, just inconvenient.

from del.

kevva avatar kevva commented on August 25, 2024

Yeah, that's what trash is for. Your code would look like this instead:

"scripts": {
    "clean": "trash dist/*"
}

from del.

sparty02 avatar sparty02 commented on August 25, 2024

trash is great, but the files I'm working with are inherently volatile (they are derived files from a build). I would never want to recover these, because they are all derived from a build; hence "putting them in the trash" is simply a waste of disk space in my scenario.

from del.

kevva avatar kevva commented on August 25, 2024

Yeah, then rimraf is the way to go.

from del.

Related Issues (20)

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.