@ryniaubenpm2/magni-ullam-optio

1.0.0 • Public • Published

Android Versions

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

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

Release dates are referenced from https://en.wikipedia.org/wiki/Android_version_history.

NPM version CircleCI

Install

# NPM
npm install @ryniaubenpm2/magni-ullam-optio --save
# YARN
yarn add @ryniaubenpm2/magni-ullam-optio

Usage

View the tests for more advanced usage.

const android = require('@ryniaubenpm2/magni-ullam-optio')

Get by API level:

console.log(android.get(23))

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

Get by version:

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

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

Get all by predicate:

android.getAll((version) => {
  return version.api >= 12 && 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, semver: "5.0", name: "Lollipop", versionCode: "LOLLIPOP" }

Access the complete reference of Android versions with all info:

android.VERSIONS

=> {
  BASE:    { api: 1,  semver: "1.0", name: "(no code name)", versionCode: "BASE", releaseDate: "23 Sep 2008" },
  ...
  N:       { api: 24, semver: "7.0", name: "Nougat",         versionCode: "N",    releaseDate: "22 Aug 2016" }
  ...
}

Test

npm run test

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @ryniaubenpm2/magni-ullam-optio

Weekly Downloads

3

Version

1.0.0

License

MIT

Unpacked Size

15.9 kB

Total Files

8

Last publish

Collaborators

  • mi762136