@lacussoft/num-onlydeprecated

Function to stringify and remove non-numeric characters of items.

Usage no npm install needed!

<script type="module">
  import lacussoftNumOnly from 'https://cdn.skypack.dev/@lacussoft/num-only';
</script>

README

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

Chrome Firefox Safari Opera Edge IE
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'