Git Product home page Git Product logo

android-versions's Introduction

Android Versions

A node module to get Android versions by API level, NDK level, semantic version, or version name.

Versions are referenced from source.android.com/source/build-numbers.html. The version for "Current Development Build" ("CUR_DEVELOPMENT") is not included in the list of VERSIONS.

NPM version build status

Install

# NPM
npm install android-versions --save
# YARN
yarn add android-versions

Usage

View the tests for more advanced usage.

const android = require('android-versions')

Get by API level:

console.log(android.get(23))

=> { api: 23, ndk: 8, semver: "6.0", name: "Marshmallow", versionCode: "M" }

Get by version:

console.log(android.get("2.3.3"))

=> { api: 10, ndk: 5, semver: "2.3.3", name: "Gingerbread", versionCode: "GINGERBREAD_MR1" }

Get all by predicate:

android.getAll((version) => {
  return version.ndk > 5 && version.api < 15
}).map((version) => version.versionCode)

=> [ "HONEYCOMB_MR1", "HONEYCOMB_MR2", "ICE_CREAM_SANDWICH" ]

Access a specific version with all info:

android.LOLLIPOP

=> { api: 21, ndk: 8, semver: "5.0", name: "Lollipop", versionCode: "LOLLIPOP" }

Access the complete reference of Android versions with all info:

android.VERSIONS

=> {
  BASE:    { api: 1,  ndk: 0, semver: "1.0", name: "(no code name)", versionCode: "BASE" },
  ...
  N:       { api: 24, ndk: 8, semver: "7.0", name: "Nougat",         versionCode: "N" }
  ...
}

Test

npm run test

License

MIT

android-versions's People

Contributors

alkawryk avatar dvoiss 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.