prune

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: MIT Imports: 6 Imported by: 0

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{
	".markdown",
	".md",
	".mkd",
	".ts",
	".jst",
	".coffee",
	".tgz",
	".swp",
}

DefaultExtensions pruned.

View Source
var DefaultFiles = []string{
	"Jenkinsfile",
	"Makefile",
	"Gulpfile.js",
	"Gruntfile.js",
	"gulpfile.js",
	".DS_Store",
	".tern-project",
	".gitattributes",
	".editorconfig",
	".eslintrc",
	"eslint",
	".eslintrc.js",
	".eslintrc.json",
	".eslintrc.yml",
	".eslintignore",
	".stylelintrc",
	"stylelint.config.js",
	".stylelintrc.json",
	".stylelintrc.yaml",
	".stylelintrc.yml",
	".stylelintrc.js",
	".htmllintrc",
	"htmllint.js",
	".lint",
	".npmrc",
	".npmignore",
	".jshintrc",
	".flowconfig",
	".documentup.json",
	".yarn-metadata.json",
	".travis.yml",
	"appveyor.yml",
	".gitlab-ci.yml",
	"circle.yml",
	".coveralls.yml",
	"CHANGES",
	"changelog",
	"LICENSE.txt",
	"LICENSE",
	"LICENSE-MIT",
	"LICENSE.BSD",
	"license",
	"LICENCE.txt",
	"LICENCE",
	"LICENCE-MIT",
	"LICENCE.BSD",
	"licence",
	"AUTHORS",
	"CONTRIBUTORS",
	".yarn-integrity",
	".yarnclean",
	"_config.yml",
	".babelrc",
	".yo-rc.json",
	"jest.config.js",
	"karma.conf.js",
	"wallaby.js",
	"wallaby.conf.js",
	".prettierrc",
	".prettierrc.yml",
	".prettierrc.toml",
	".prettierrc.js",
	".prettierrc.json",
	"prettier.config.js",
	".appveyor.yml",
	"tsconfig.json",
	"tslint.json",
}

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 WithExceptions added in v1.2.0

func WithExceptions(s []string) Option

WithExceptions option.

func WithExtensions

func WithExtensions(s []string) Option

WithExtensions option.

func WithFiles

func WithFiles(s []string) Option

WithFiles option.

func WithGlobs added in v1.2.0

func WithGlobs(s []string) Option

WithGlobs 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.

Jump to

Keyboard shortcuts

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