🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

latest-lib

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

latest-lib

Get the latest version of a CSS or JavaScript library hosted on CDNJS

latest
Source
npmnpm
Version
0.2.1
Version published
Weekly downloads
483
113.72%
Maintainers
1
Weekly downloads
 
Created
Source

latest-lib Build Status

Get the latest version of a CSS or JavaScript library hosted on CDNJS

Install

$ npm install --save latest-lib

Usage

const latestLib = require('latest-lib');

// search for the latest version of bootstrap
latestLib('bootstrap')
.then(library => console.log(library))
//=> {name: 'twitter-bootstrap', version: '4.0.0-alpha.6', files: [...]}
.catch(err => console.log(err));

// search for the latest version of bootstrap 3
latestLib('bootstrap@3')
.then(library => console.log(library))
//=> {name: 'twitter-bootstrap', version: '3.3.7', files: [...]}
.catch(err => console.log(err));

API

latestLib(name[, opts])

Returns a Promise containing an object with the following properties:

  • On success:

    • name String
    • version String
    • files Array
  • On error:

    • an Error object

name

Type: String

The name of the library

Suffixing the name with @[number] will fetch the latest version of [number] major release

opts

Type: Object

only

Type: String

Possible choices:

  • css
    • return only the .css files of the library in the response
  • js
    • return only the .js files of the library in the response

License

MIT © Gabriel Mangiurea

Keywords

latest

FAQs

Package last updated on 30 Apr 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