1.2.1 • Published 7 years ago

time-my-words v1.2.1

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

Text to time library for node.

Installation

Installation is done using the npm install command:

$ npm install time-my-words

Examples

Time

The time funcion estimates the time spent reading the input(inserted) text.

var tmw = require('time-my-words');

var result = tmw.time('A lot of text');
// result = 00:04:32

Configuration Object

The output can be configured adding a configuration object as the second parameter of the time function. The three configurable options are language(lang),label (label), and the position of the label (label_position).

var tmw = require('time-my-words');

var result = tmw.time('A lot of text', {
    lang: 'en',
    label: 'read',
    label_position: 'end'
});
// result = 4 minutes read

Available languages for the moment:

  • English (en)
  • Spanish (es)

Format

The format function is the isolated equivalent to adding a configuration object in the time function.

var tmw = require('time-my-words');

var result = tmw.time('A lot of text');

result = tmw.format(result, {
    lang: 'en',
    label: 'read',
    label_position: 'end'
});
// result = 4 minutes read

License

MIT

1.2.1

7 years ago

1.1.9

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.0

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago