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

js2bin-version-info

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js2bin-version-info

Helper module for js2bin. Resolve version information from online resources.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

build npm version

js2bin version info

Helper module for js2bin. Resolve version information from online resources.

Usage

const { VersionInfo } = require('js2bin-version-info');

/**
 * Returns the latest version, for the "build" command.
 */
const getVersionForBuild = async () => {
  const info = new VersionInfo();
  const version = await info.get('build');
  return version;
};

/**
 * Returns an array of the latest versions, for the "ci" command.
 * It will return an empty array if all the latest versions are already
 * available in the js2bin release assets.
 */
const getVersionsForCi = async () => {
  const info = new VersionInfo();
  const versions = await info.get('ci');
  return versions;
};

Options

You can give options either when you create an instance or when you get versions.

const info = new VersionInfo(opt);
  • @param {object} [opt] - options
  • @param {boolean} [opt.active] - for 'ci', get only the latest active version
  • @param {boolean} [opt.current] - for 'ci', include current nodejs release
  • @param {number} [opt.timeout] - timeout on fetch, in milliseconds
const getVersionsForCi = async () => {
  const info = new VersionInfo({
    current: true,
    timeout: 10000
  });
  const versions = await info.get('ci');
  return versions;
};

const getVersionForBuild = async () => {
  const info = new VersionInfo();
  const version = await info.get('build', {
    timeout: 10000
  });
  return version;
};

Demo

Run npm run demo for the live demo.

FAQs

Package last updated on 06 Dec 2020

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