0.1.6 • Published 2 years ago

gitignore.io v0.1.6

Weekly downloads
5
License
MIT
Repository
github
Last release
2 years ago

gitignore.io

A Javascript SDK for https://gitignore.io

Installation

npm install --save gitignore.io
# -or-
yarn add gitignore.io

Usage

Documentation is available here

  • Import library
const api = require('gitignore.io');
  • Get list of all available configs
    • Returns an Array of config names
api.listAll().then(list => console.log(list));

// returns
//
// [
//   '1c',                '1c-bitrix',           'a-frame',
//   'actionscript',      'ada',                 'adobe',
//   'advancedinstaller', 'adventuregamestudio', 'agda',
//   'al',                'alteraquartusii',     'altium',
//   ......
  • Fetch all available configs with metadata
    • Returns an Object of all configs
api.fetchAll().then(allConfigs => console.log(allConfigs));

// returns
//
// {
//   certificates: {
//     contents: '\n### certificates ###\n*.pem\n*.key\n*.crt\n*.priv\n',
//     name: 'certificates',
//     key: 'certificates',
//     fileName: 'certificates.gitignore'
//   },
//   vaadin: {
//     contents: '\n### Vaadin ###\n.vaadin-designer\n.designer\n',
//     name: 'Vaadin',
//     key: 'vaadin',
//     fileName: 'Vaadin.gitignore'
//   },
//   ........
  • Fetch a final config file for specified config names
    • Returns a String of config
api.fetchConfig(['node', 'code', 'linux']).then(config => console.log(config));

// returns
//
// ### Code ###
// .vscode/*
// !.vscode/settings.json
// !.vscode/tasks.json
// !.vscode/launch.json
// !.vscode/extensions.json

// ### Linux ###
// *~

// # temporary files which can be created if a process still has a handle open of a deleted file
// .fuse_hidden*

TODO

  • Proper error handling
  • Rewrite to Typescript
  • Add typings
  • Add browser support
  • Publish to npm
  • Add CLI
0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

3 years ago

0.1.2

3 years ago

0.1.3

3 years ago

0.1.1

4 years ago

0.1.0

4 years ago