g-status

WebJar for g-status

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

g-status
Последняя версия

Последняя версия

2.0.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

g-status
WebJar for g-status
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/luftywiranda13/g-status

Скачать g-status

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/g-status/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>g-status</artifactId>
    <version>2.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/g-status/
implementation 'org.webjars.npm:g-status:2.0.2'
// https://jarcasting.com/artifacts/org.webjars.npm/g-status/
implementation ("org.webjars.npm:g-status:2.0.2")
'org.webjars.npm:g-status:jar:2.0.2'
<dependency org="org.webjars.npm" name="g-status" rev="2.0.2">
  <artifact name="g-status" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='g-status', version='2.0.2')
)
libraryDependencies += "org.webjars.npm" % "g-status" % "2.0.2"
[org.webjars.npm/g-status "2.0.2"]

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.webjars.npm : arrify jar [1.0.1,2)
org.webjars.npm : matcher jar [1.0.0,2)
org.webjars.npm : simple-git jar [1.85.0,2)

Модули Проекта

Данный проект не имеет модулей.

g-status

Get the change between index (or staging-area) and working directory of a git repository

Package Version Downloads Status Build Status: Linux Coverage Status

Think of git status or git status --porcelain, but returns a ready-to-consume result.

Why

  • Maintained
  • Accepts simple wildcard matching patterns
  • Promise API
  • Ability to get specific results based on status codes
  • Knows which files are partially/fully-staged

Installation

npm install g-status

Usage

$ git status --porcelain

A  .travis.yml  # fully-staged
MM index.js     # partially-staged
 M readme.md    # unstaged
const gStatus = require('g-status');

gStatus().then(res => {
  console.log(res);
  /*
    [
      { path: '.travis.yml', index: 'A', workingTree: ' ' },
      { path: 'index.js', index: 'M', workingTree: 'M' },
      { path: 'readme.md', index: ' ', workingTree: 'M' }
    ]
  */
});

gStatus({ path: ['!*.js', '!*.md'] }).then(res => {
  console.log(res);
  //=> [{ path: '.travis.yml', index: 'A', workingTree: ' ' }]
});

// Files marked as `Modified` or `Added` in the staging area,
gStatus({ index: 'MA' }).then(res => {
  console.log(res);
  /*
    [
      { path: '.travis.yml', index: 'A', workingTree: ' ' },
      { path: 'index.js', index: 'M', workingTree: 'M' },
    ]
  */
});

// Files that arenʼt changed in the working tree
gStatus({ workingTree: ' ' }).then(res => {
  console.log(res);
  //=> [{ path: '.travis.yml', index: 'A', workingTree: ' ' }]
});

// Files that are marked as `Modified` both in staging area and working tree
gStatus({ index: 'M', workingTree: 'M' }).then(res => {
  console.log(res);
  //=> [{ path: 'index.js', index: 'M', workingTree: 'M' }]
});

See the tests for more usage examples and expected matches.

API

gStatus([options])

Returns Promise<{ path: string, index: string, workingTree: string }[]>.

options

Type: Object

cwd

Type: string
Default: process.cwd()

Current working directory.

path

Type: string | string[]
Default: *

Use * to match zero or more characters. A pattern starting with ! will be negated.

index

Type: string
Default: *

String of git status codes of the index/staging-area, See Short Format.
One difference is that * will match all value here.

workingTree

Type: string
Default: *

String of git status codes of the working tree, See Short Format.
One difference is that * will match all value here.

Related

License

MIT © Lufty Wiranda

Версии библиотеки

Версия
2.0.2