JSPM

parse-int

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 25288
  • Score
    100M100P100Q144610F
  • License MIT

Strict integer parsing

Package Exports

  • parse-int

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (parse-int) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

parse-int Build Status Greenkeeper badge

Strict integer parsing. If it's not an actual integer or an integer string, return undefined.

Install

$ npm install --save parse-int

Usage

var parseInt = require('parse-int');

parseInt(2) // 2
parseInt('2') // 2
parseInt('2.2') // undefined
parseInt(1.2) // undefined
parseInt('2a') // undefined
parseInt() // undefined

API

parseInt(number) -> number / undefined

number

Required
Type: any

The number to attempt to parse.

License

MIT © Ben Drucker