All Projects → yandex → tartifacts

yandex / tartifacts

Licence: MIT license
📦 Create artifacts for your assemblies

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to tartifacts

Cpx
A cli tool to watch and copy file globs.
Stars: ✭ 394 (+1870%)
Mutual labels:  copy, glob
Xcv
✂️ Cut, Copy and Paste files with Bash
Stars: ✭ 144 (+620%)
Mutual labels:  copy, glob
PLzmaSDK
PLzmaSDK is (Portable, Patched, Package, cross-P-latform) Lzma SDK.
Stars: ✭ 28 (+40%)
Mutual labels:  tarball, tar
tarballjs
Javascript library to create or read tar files in the browser
Stars: ✭ 24 (+20%)
Mutual labels:  tarball, tar
go-tarfs
Read a tar file contents using go1.16 io/fs abstraction
Stars: ✭ 18 (-10%)
Mutual labels:  tarball, tar
Copy Webpack Plugin
Copy files and directories with webpack
Stars: ✭ 2,679 (+13295%)
Mutual labels:  copy, glob
Rollup Plugin Copy
Copy files and folders using Rollup
Stars: ✭ 128 (+540%)
Mutual labels:  copy, glob
Globby
User-friendly glob matching
Stars: ✭ 1,864 (+9220%)
Mutual labels:  patterns, glob
Tiny Glob
Super tiny and ~350% faster alternative to node-glob
Stars: ✭ 710 (+3450%)
Mutual labels:  patterns, glob
glob-fs
file globbing for node.js. speedy and powerful alternative to node-glob. This library is experimental and does not work on windows!
Stars: ✭ 54 (+170%)
Mutual labels:  patterns, glob
Fast Glob
🚀 It's a very fast and efficient glob library for Node.js
Stars: ✭ 1,150 (+5650%)
Mutual labels:  patterns, glob
deglob
📂 Take a list of glob patterns and return an array of file locations, respecting `.gitignore` and allowing for ignore patterns via `package.json`.
Stars: ✭ 38 (+90%)
Mutual labels:  patterns, glob
Inventory Kamera
Scans Genshin Impact characters, artifacts, and weapons from the game window into a JSON file.
Stars: ✭ 348 (+1640%)
Mutual labels:  artifacts
dagger2-clean-mvp-example
Sample project with a basic approach to CLEAN architecture on Android
Stars: ✭ 41 (+105%)
Mutual labels:  patterns
KubernetesPatterns
YAML and Golang implementations of common Kubernetes patterns.
Stars: ✭ 71 (+255%)
Mutual labels:  patterns
bowman
A simple static site generator with an integrated toolchain for efficient development and delivery.
Stars: ✭ 17 (-15%)
Mutual labels:  glob
gan-error-avoidance
Learning to Avoid Errors in GANs by Input Space Manipulation (Code for paper)
Stars: ✭ 23 (+15%)
Mutual labels:  artifacts
s3-practical-guide
A practical guide for Sociocracy 3.0.
Stars: ✭ 56 (+180%)
Mutual labels:  patterns
techne
Design Guidelines, Components and Patterns Library for modern, mobile-first, user-centric Experience Design
Stars: ✭ 40 (+100%)
Mutual labels:  patterns
to-absolute-glob
Make a glob pattern absolute, ensuring that negative globs and patterns with trailing slashes are correctly handled.
Stars: ✭ 16 (-20%)
Mutual labels:  glob

tartifacts

NPM Status Travis Status Windows Status Coverage Status Dependency Status

The tool to create artifacts for your assemblies.

Copy only the necessary files and pack them in tar.gz file.

It works much faster than removing unnecessary files and packing with command-line utility tar.

For example, 1 minute vs 10 seconds for project with 20 thousand files (80 Mb).

Install

$ npm install --save tartifacts

Usage

const writeArtifacts = require('tartifacts');
const artifacts = [
    {
        name: 'artifact.tar.gz',
        patterns: ['sources/**', '!sources/exlib/**'],
        tar: true,
        gzip: { level: 9 }
    },
    {
        name: 'artifact-dir',
        includes: 'sources/**',
        excludes: 'sources/exlib/**',
        dotFiles: false // exclude dotfiles, override general settings
    }
];

writeArtifacts(artifacts, {
    root: './path/to/my-project/', // files of artifacts will be searched from root by artifact patterns,
                                   // for example: ./path/to/my-project/sources/**
    destDir: './dest/',
    dotFiles: true,    // include dotfiles
    emptyFiles: true,  // include empty files
    emptyDirs: true    // include empty directories
})
.then(() => console.log('Copying and packaging of artifacts completed!'))
.catch(console.error);

or advanced one which is especially useful for watch mode

const Tartifacts = require('tartifacts').Tartifacts;
const tartifacts = new Tartifacts({
    watch: true // files and directories will be added to the destination artifact
                // in runtime as soon as they appear on the file system
});

process.on('SIGTERM', () => tartifacts.closeArtifacts());

tartifacts.writeArtifacts({
    name: 'artifact.tar.gz',
    patterns: ['sources/**']
})
.then(() => {
    // will be resolved only after "tartifacts.closeArtifacts()"" call on "SIGTERM" event
    // and all artifacts are ready
})

API

writeArtifacts(artifacts, [options])

Searchs files of artifact by glob patterns and writes them to artifact in fs.

Tartifacts([options])

Constructor which creates an instance of Tartifacts with the methods described below.

Tartifacts.prototype.writeArtifacts(artifacts)

Does the same as function writeArtifacts.

Tartifacts.prototype.closeArtifacts

Method which is useful when artifacts are created in watch mode and should be called in order to resolve Tartifacts.prototype.writeArtifacts (see the usage above).

artifacts

Type: object, object[]

The info about artifacts or one artifact.

Each artifact object has the following fields:

artifact.name

Type: string

The artifact name of file or directory.

artifact.root

Type: string

Default: precess.cwd()

The path to root directory.

The patterns, includes and excludes will be resolved from root.

artifact.destDir

Type: string

The path to destination directory of artifact.

The dest and name will be resolved from destDir. If destDir is not specified, dest and name will be resolved from root.

artifact.patterns

Type: string, string[], object

Default: []

The paths to files which need to be included or excluded.

Read more about patterns in glob package.

artifact.includes

Type: string, string[]

Default: []

The paths to files which need to be included.

artifact.excludes

Type: string, string[]

Default: []

The paths to files which need to be excluded.

Can be specifed as an object:

{
    name: 'artifact',
    patterns: {
        './subdir1': ['dir1/**'],
        './subdir2': ['dir2/**']
    }
}

This means that all files which match dir1/** will be added to directory artifact/subdir1 and all files which match dir2/** will be added to directory artifact/subdir2, so, for example, file ./dir1/file.ext will be added to artifact as ./artifact/subdir1/dir1/file.ext and file, for ./dir2/file.ext will be added to artifact as ./artifact/subdir2/dir2/file.ext.

artifact.tar

Type: boolean

Default: false

If true, destination directory will be packed to tarball file.

Otherwise files of artifact will be copied to destination directory.

artifact.gzip

Type: boolean, object

Default: false

If true, tarball file will be gzipped.

To change the compression level pass object with level field.

artifact.followSymlinks

Type: boolean

Default: false

Follow symlinked files and directories.

Note that this can result in a lot of duplicate references in the presence of cyclic links.

artifact.dotFiles

Type: boolean

Default: true

Include dotfiles.

artifact.emptyFiles

Type: boolean

Default: true

Include empty files.

artifact.emptyDirs

Type: boolean

Default: true

Include empty directories.

artifact.transform

Type: Function

Default: null

It allows you to modify files before they are archived/copied.

Transform function has one argument with type {path: string, relative: string, base: string, cwd: string, history: string[]} and should return the modified chunk or array of chunks.

Note: now support only sync functions

Example

artifact.watch

Type: boolean

Default: false

Tartifacts will work in an observe mode which means that all files and directories will be added to a destination directory or archive as soon as they appear on a file system.

Note: it is recommended to use this mode with the advanced API which is described in the usage above in order to have the ability to stop the tool

options

Type: object

Allows you to configure settings for write artifacts.

The options specify general settings for all artifacts:

License

MIT © Andrew Abramov

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].