Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tagged-versions

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tagged-versions

Get tagged semver-compatible project versions

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

tagged-versions

Get tagged semver-compatible project versions [{ version, tag, hash, date }]

Build Status Coverage Status NPM version

Installation

npm install tagged-versions --save

Supported Node versions: 5+

Usage

All project versions

Return all the tagged project versions:

const taggedVersions = require('tagged-versions');
return taggedVersions.getList()
  .then(versions => console.log(versions));

// [
//   { version: '1.2.0', tag: 'v1.2.0', hash: 'f6bf448b02c489c8676f2eeaaac72ef93980baf2', date: <Date> },
//   { version: '1.1.1', tag: 'v1.1.1', hash: 'b656238b0fc2502b19bd0e803eb87447840dc52a', date: <Date> },
//   { version: '1.1.0', tag: 'v1.1.0', hash: '1d56b88b0fc2585ffaf43e416b87440667c3c53f', date: <Date> },
//   { version: '1.0.0', tag: 'v1.0.0', hash: '06743d3f902b19bd0e802e40462d87ba2b05740d', date: <Date> },
// ]

You can optionally filter versions with a semver range:

const taggedVersions = require('tagged-versions');
return taggedVersions.getList('^1.1.0')
  .then(versions => console.log(versions));

// [
//   { version: '1.2.0', tag: 'v1.2.0', hash: 'f6bf448b02c489c8676f2eeaaac72ef93980baf2', date: <Date> },
//   { version: '1.1.1', tag: 'v1.1.1', hash: 'b656238b0fc2502b19bd0e803eb87447840dc52a', date: <Date> },
//   { version: '1.1.0', tag: 'v1.1.0', hash: '1d56b88b0fc2585ffaf43e416b87440667c3c53f', date: <Date> },
// ]

Or with a revision range:

const taggedVersions = require('tagged-versions');
return taggedVersions.getList({rev: 'v1.1.0..v1.2.0'})
  .then(versions => console.log(versions));

// [
//   { version: '1.2.0', tag: 'v1.2.0', hash: 'f6bf448b02c489c8676f2eeaaac72ef93980baf2', date: <Date> },
//   { version: '1.1.1', tag: 'v1.1.1', hash: 'b656238b0fc2502b19bd0e803eb87447840dc52a', date: <Date> }
// ]

Last project version

Return the last tagged project version:

const taggedVersions = require('tagged-versions');
return taggedVersions.getLastVersion()
  .then(versions => console.log(version));

// {
//   version: '1.2.0',
//   tag: 'v1.2.0',
//   hash: 'f6bf448b02c489c8676f2eeaaac72ef93980baf2',
//   date: new Date('2016-10-08T10:47:01.000Z')
// }

Like with getList, you can also filter with a semver range:

const taggedVersions = require('tagged-versions');
return taggedVersions.getLastVersion('~1.1')
  .then(versions => console.log(version));

// {
//   version: '1.1.1',
//   tag: 'v1.1.1',
//   hash: 'b656238b0fc2502b19bd0e803eb87447840dc52a',
//   date: new Date('2016-10-01T16:34:24.000Z')
// }

Contributing

Please follow the Airbnb guidelines and commit your changes with commitzen using git cz.

Keywords

FAQs

Package last updated on 20 Jan 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc