1.1.1 • Published 2 years ago

num-only v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

num-only

NPM Latest Version Downloads Count Bundle Size Test Status Last Update Date Project License

Node package with a function to stringify and remove non-numeric characters of items.

Browser Support

ChromeFirefoxSafariOperaEdgeIE
Latest ✔Latest ✔Latest ✔Latest ✔Latest ✔11 ✔

Installation

$ npm install num-only

Import

// ES Modules
import numOnly from 'num-only'

// Common JS
const numOnly = require('num-only')

or import it through your HTML file, using CDN:

<script src="https://cdn.jsdelivr.net/npm/num-only@latest/dist/num-only.min.js"></script>

Usage

numOnly('12345')                  // returns '12345'
numOnly('abc123')                 // returns '123'
numOnly(['a', 'b', 'c', 1, 2, 3]) // returns '123'
numOnly(true)                     // returns ''
numOnly(() => 5 + 3)              // returns '53'