Git Product home page Git Product logo

assertvalidversion's Introduction

assertValidVersion 1.0.0 experimental

Validate an entry in the "dependencies" object inside any package.json!

assertValidVersion = require "assertValidVersion"

promise = assertValidVersion moduleName, versionString

"Does an NPM package have a specific version?"

assertValidVersion "underscore", "1.8.3"

.then ->
  # The version is valid!
  # Since `npm view underscore` includes
  # '1.0.1' in the list of NPM versions.

.fail (error) ->
  # An error is thrown if:
  #   • the NPM package does not exist
  #   • the given version does not exist
  #   • the given version is not properly formatted
  • Supports version ranges! (eg: >=1.0.0)

"Does a Github repository have a specific tag?"

assertValidVersion "Type", "aleclarson/Type#1.0.0"

.then ->
  # The version is valid!
  # Since 'github.com/aleclarson/Type/tags' includes
  # '1.0.0' in the list of remote tags.

.fail (error) ->
  # An error is thrown if:
  #   • the Github repository does not exist
  #   • the given tag is not included in the list of remote tags
  #   • the given version is not properly formatted

assertvalidversion's People

Contributors

aleclarson avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.