# @types/gitignore-parser

> TypeScript definitions for gitignore-parser

Latest version **0.0.3** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/gitignore-parser
pnpm add @types/gitignore-parser
yarn add @types/gitignore-parser
bun add @types/gitignore-parser
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2023-11-07 |
| First published | 2021-01-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51449 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/gitignore-parser
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gitignore-parser
- npm.io page: https://npm.io/package/@types/gitignore-parser

## Recent versions

- 0.0.3 (latest) — 2023-11-07
- 0.0.0 (ts3.4) — 2021-01-12
- 0.0.2 — 2023-10-18
- 0.0.1 — 2023-09-20

## README

# Installation
> `npm install --save @types/gitignore-parser`

# Summary
This package contains type definitions for gitignore-parser (https://github.com/codemix/gitignore-parser).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gitignore-parser.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/gitignore-parser/index.d.ts)
````ts
/**
 * Compile the given `.gitignore` content (not filename!)
 * and return an object with `accepts`, `denies` and `maybe` methods.
 * These methods each accepts a single filename and determines whether
 * they are acceptable or unacceptable according to the `.gitignore` definition.
 */
export function compile(
    content: string,
): {
    accepts(input: string): boolean;
    denies(input: string): boolean;
    maybe(input: string): boolean;
};

/**
 * Parse the given `.gitignore` content and return an array
 * containing two further arrays - positives and negatives.
 * Each of these two arrays in turn contains two regexps, one
 * strict and one for 'maybe'.
 */
export function parse(content: string): [GitignoreParseResultSet, GitignoreParseResultSet];

export type GitignoreParseResultSet = [RegExp, RegExp]; // [strict, maybe]

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
 * Dependencies: none

# Credits
These definitions were written by [Alex Nuccio](https://github.com/anuccio1), and [Matt Schwartz](https://github.com/microsoftly).

---
_Source: https://npm.io/package/@types/gitignore-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
