# vizion

> Git/Subversion/Mercurial repository metadata parser

Latest version **2.2.1** (published 2021-01-29) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install vizion
pnpm add vizion
yarn add vizion
bun add vizion
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.1 |
| Published | 2021-01-29 |
| First published | 2014-10-28 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.0 |
| Dependencies | 4 |
| Unpacked size | 50 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 40 |
| Author | Keymetrics |
| Maintainers | tknew, wallet77, vmarchaud |
| Keywords | git, svn, hg, subversion, mercurial, repository, parser, versioning, revision |

## Links

- npm: https://www.npmjs.com/package/vizion
- Repository: https://github.com/keymetrics/vizion
- Homepage: https://github.com/keymetrics/vizion#readme
- Issues: https://github.com/keymetrics/vizion/issues
- npm.io page: https://npm.io/package/vizion

## Dependencies (4)

- [ini](https://npm.io/package/ini.md) ^1.3.5
- [async](https://npm.io/package/async.md) ^2.6.3
- [js-git](https://npm.io/package/js-git.md) ^0.7.8
- [git-node-fs](https://npm.io/package/git-node-fs.md) ^1.0.0

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 2.2.1 (latest) — 2021-01-29
- 1.0.0-beta1 (next) — 2017-03-15
- 2.2.0 — 2020-04-13
- 2.1.1 — 2020-04-12
- 2.1.0 — 2020-04-12
- 2.0.2 — 2018-07-20
- 2.0.1 — 2018-07-09
- 2.0.0 — 2018-03-26
- 0.2.13 — 2016-07-13
- 0.2.12 — 2015-11-05
- 0.2.11 — 2015-06-23
- 0.2.10 — 2015-06-22
- 0.2.9 — 2015-06-05
- 0.2.8 — 2015-05-20
- 0.2.7 — 2015-04-24
- … 17 more at https://npm.io/package/vizion/versions

## README

# Repository parser

Git/Subversion/Mercurial repository metadata parser

[![Build Status](https://api.travis-ci.org/keymetrics/vizion.png?branch=master)]

## Example

```javascript
var vizion = require('vizion');

/**
 * Grab metadata for svn/git/hg repositories
 */
vizion.analyze({
  folder : '/tmp/folder'
}, function(err, meta) {
  if (err) throw new Error(err);

  /**
   *
   * meta = {
   *   type        : 'git',
   *   ahead       : false,
   *   unstaged    : false,
   *   branch      : 'development',
   *   remotes     : [ 'http', 'http ssl', 'origin' ],
   *   remote      : 'origin',
   *   commment    : 'This is a comment',
   *   update_time : Tue Oct 28 2014 14:33:30 GMT+0100 (CET),
   *   url         : 'https://github.com/keymetrics/vizion.git',
   *   revision    : 'f0a1d45936cf7a3c969e4caba96546fd23255796',
   *   next_rev    : null,  // null if its latest in the branch
   *   prev_rev    : '6d6932dac9c82f8a29ff40c1d5300569c24aa2c8'
   * }
   *
   */
});

/**
 * Check if a local repository is up to date with its remote
 */
vizion.isUpToDate({
  folder : '/tmp/folder'
}, function(err, meta) {
  if (err) throw new Error(err);

  /**
   *
   * meta = {
   *   is_up_to_date    : false,
   *   new_revision     : '6d6932dac9c82f8a29ff40c1d5300569c24aa2c8'
   *   current_revision : 'f0a1d45936cf7a3c969e4caba96546fd23255796'
   * }
   *
   */
});

/**
 * Update the local repository to latest commit found on the remote for its current branch
 * - on fail it rollbacks to the latest commit
 */
vizion.update({
  folder : '/tmp/folder'
}, function(err, meta) {
  if (err) throw new Error(err);

  /**
   *
   * meta = {
   *   success           : true,
   *   current_revision  : '6d6932dac9c82f8a29ff40c1d5300569c24aa2c8'
   * }
   *
   */
});

/**
 * Revert to a specified commit
 * - Eg: this does a git reset --hard <commit_revision>
 */
vizion.revertTo({
  revision : 'f0a1d45936cf7a3c969e4caba96546fd23255796',
  folder   : '/tmp/folder'
}, function(err, data) {
  if (err) throw new Error(err);

  /**
   *
   * data = {
   *   success          : true,
   * }
   *
   */
});

/**
 * If a previous commit exists it checkouts on it
 */
vizion.prev({
  folder : '/tmp/folder'
}, function(err, meta) {
  if (err) throw new Error(err);

  /**
   *
   * meta = {
   *   success           : true,
   *   current_revision  : '6d6932dac9c82f8a29ff40c1d5300569c24aa2c8'
   * }
   *
   */
});

/**
 * If a more recent commit exists it checkouts on it
 */
vizion.next({
  folder : '/tmp/folder'
}, function(err, meta) {
  if (err) throw new Error(err);

  /**
   *
   * meta = {
   *   success           : false,
   *   current_revision  : '6d6932dac9c82f8a29ff40c1d5300569c24aa2c8'
   * }
   *
   */
});
```

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