words-per-minute
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "words-per-minute", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Words per minute is a common metric for assessing reading speed. Calculate it with JS", | ||
@@ -26,9 +26,12 @@ "main": "src/lib/words-per-minute.js", | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module" | ||
"ecmaVersion": 6, | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"semi": ["error", "never"] | ||
"semi": [ | ||
"error", | ||
"never" | ||
] | ||
} | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# words-per-minute | ||
# words-per-minute - reading time | ||
Words per minute is a common metric for assessing reading speed. Calculate it with JS | ||
@@ -11,2 +11,3 @@ | ||
const getMinutesFromText = require('words-per-minute').getMinutesFromText | ||
const getWordsPerMinutes = require('words-per-minute').getWordsPerMinutes | ||
@@ -16,2 +17,4 @@ const text = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.' | ||
getWordsPerMinutes(3) // 639 | ||
``` |
@@ -7,2 +7,9 @@ const assert = require('assert') | ||
it('no text', function () { | ||
let text = '' | ||
let actual = getMinutesFromText(text) | ||
let expected = 1 | ||
assert.equal(actual, expected, 'with no text should return 1 min') | ||
}) | ||
it('smallest text', function () { | ||
@@ -9,0 +16,0 @@ let text = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry.' |
10034
86
19