prune

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2017 License: MIT Imports: 6 Imported by: 0

README

What?

node-prune is a small tool to prune unnecessary files from ./node_modules, such as markdown, typescript source files, and so on.

Installation

$ go get github.com/tj/node-prune/cmd/node-prune

Usage

In your app directory:

$ node-prune

files total 27,330
files removed 3,990
size removed 13 MB
   duration 200ms

Somewhere else:

$ node-prune path/to/node_modules

files total 27,330
files removed 3,990
size removed 13 MB
   duration 200ms

Why?

huge


GoDoc

Documentation

Overview

Package prune provides node_modules pruning of unnecessary files.

Index

Constants

This section is empty.

Variables

View Source
var DefaultDirectories = []string{
	"__tests__",
	"test",
	"tests",
	"powered-test",
	"docs",
	"doc",
	".idea",
	".vscode",
	"website",
	"images",
	"assets",
	"example",
	"examples",
	"coverage",
	".nyc_output",
	".circleci",
	".github",
}

DefaultDirectories pruned.

Copied from yarn (mostly).

View Source
var DefaultExtensions = []string{
	".md",
	".ts",
	".jst",
	".coffee",
	".tgz",
	".swp",
}

DefaultExtensions pruned.

View Source
var DefaultFiles = []string{
	"Makefile",
	"Gulpfile.js",
	"Gruntfile.js",
	".DS_Store",
	".tern-project",
	".gitattributes",
	".editorconfig",
	".eslintrc",
	".eslintrc.js",
	".eslintignore",
	".npmignore",
	".jshintrc",
	".flowconfig",
	".documentup.json",
	".yarn-metadata.json",
	".travis.yml",
	"appveyor.yml",
	"circle.yml",
	".coveralls.yml",
	"CHANGES",
	"LICENSE.txt",
	"LICENSE",
	"AUTHORS",
	"CONTRIBUTORS",
	".yarn-integrity",
	".yarnclean",
}

DefaultFiles pruned.

Copied from yarn (mostly).

Functions

This section is empty.

Types

type Option

type Option func(*Pruner)

Option function.

func WithDir

func WithDir(s string) Option

WithDir option.

func WithDirectories

func WithDirectories(s []string) Option

WithDirectories option.

func WithExtensions

func WithExtensions(s []string) Option

WithExtensions option.

func WithFiles

func WithFiles(s []string) Option

WithFiles option.

type Pruner

type Pruner struct {
	// contains filtered or unexported fields
}

Pruner is a module pruner.

func New

func New(options ...Option) *Pruner

New with the given options.

func (*Pruner) Prune

func (p *Pruner) Prune() (*Stats, error)

Prune performs the pruning.

type Stats

type Stats struct {
	FilesTotal   int64
	FilesRemoved int64
	SizeRemoved  int64
}

Stats for a prune.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL