react-humanize-duration

Humanize a number into time in React and React Native

Usage no npm install needed!

<script type="module">
  import reactHumanizeDuration from 'https://cdn.skypack.dev/react-humanize-duration';
</script>

README

React Humanize Duration

Humanize a number into time in React and React Native 10001 second

CI Version Downloads Install size

NPM

Try in CodeSandbox

Edit react-camelcase

Install

$ npm install react-humanize-duration

Usage

import HumanizeDuration from 'react-humanize-duration';

const App = () => (
  <div>
    <HumanizeDuration duration={1000} />
  </div>
);

// => '1 second'

API

number={input}

Type: integer

<HumanizeDuration duration={1000} />

// => '1 second'

language={object}

Type: object

<HumanizeDuration duration={1000} language={{ language: 'es' }} />

// => '1 segundo'

License

MIT © Yohix