gitignore-to-dockerignore
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

Gitignore → Dockerignore

Generate an equivalent .dockerignore file from existing .gitignore files.

New in 3.0, handles multiple .gitignore files in a directory and its subdirectories, just like Git does.

Installation

npm install --save gitignore-to-dockerignore

Usage

API

Directory input

import generateDockerignore from 'gitignore-to-dockerignore'

console.log(await generateDockerignore(process.cwd()))
// .git/
// node_modules/
// **/*.log
//
// # From tests/.gitignore
// tests/**/*.log

String input

import { convertToDockerignore } from 'gitignore-to-dockerignore'

const input = `
/node_modules/
*.log
`

console.log(convertToDockerignore(input))
// .git/
// node_modules/
// **/*.log

CLI

# Write a single .dockerignore file from .gitignore files in the current directory and subdirectories
gitignore-to-dockerignore

/gitignore-to-dockerignore/

    Package Sidebar

    Install

    npm i gitignore-to-dockerignore

    Weekly Downloads

    376

    Version

    3.0.0

    License

    MIT

    Unpacked Size

    9.45 kB

    Total Files

    8

    Last publish

    Collaborators

    • linusu