Created
January 23, 2016 15:29
-
-
Save esnya/7fb2a60b98619614bae1 to your computer and use it in GitHub Desktop.
node_modulesをお掃除するスクリプト
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import std.algorithm; | |
| import std.file; | |
| import std.path; | |
| import std.parallelism; | |
| import std.process; | |
| import std.range; | |
| import std.stdio; | |
| void main() { | |
| foreach(name; dirEntries("node_modules", SpanMode.shallow) | |
| .map!(a => a.name.baseName) | |
| .filter!`!a.startsWith(".")` | |
| .array | |
| .parallel | |
| ) { | |
| writeln("npm rm ", name); | |
| spawnProcess(["npm.cmd", "rm", "--progress=false", name]).wait(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment