
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@knod/string-time
Advanced tools
Calculates how long a string should stay visible using the characteristics of that string, corresponding millisecond values, and other data
Calculates how long a string should stay visible using the characteristics of that string, corresponding millisecond values, and other data
npm install --save string-time
Just download the zip from github or fork and clone the repo
See Contributing
var settings = {
_baseDelay: 150, // based on 400 wpm (1/(400/60)*1000)
slowStartDelay: 3,
sentenceDelay: 2,
otherPuncDelay: 5,
numericDelay: 3.2,
shortWordDelay: 1.3,
longWordDelay: 1.5,
}
var stm = new StringTime( settings ),
delay1 = stm.calcDelay( 'gone.', false ), // 300
delay1 = stm.calcDelay( 'gone.' ), // 300
delay2 = stm.calcDelay( 'gone.' ); // 200 (see description below for explanation)
var STm = require('dist/String-Time'),
settings = {
_baseDelay: 150, // based on 400 wpm
slowStartDelay: 3,
sentenceDelay: 2,
otherPuncDelay: 5,
numericDelay: 3.2,
shortWordDelay: 1.3,
longWordDelay: 1.5,
};
var stm = new STm( settings ),
delay1 = stm.calcDelay( 'gone.', false ), // 600
delay1 = stm.calcDelay( 'gone.' ), // 600
delay2 = stm.calcDelay( 'gone.' ); // 400 (see description below for explanation)
Meant to be used with Readerly's other modules, this object is tricky, and very tangled up with the code that creates and uses it. The creator of a StringTime instance (stm) passes in a reference to an object which can contain these used properties:
Base delay to start with:
Delay modifiers/multipliers to change the base delay:
When stm.calcDelay(str, bool) is called, it tests the properties of the string str. It then uses the base delay multiplied by whichever modifiers are relevant to return how many milliseconds a string should be displayed in the RSVP app.
StringTime depends on settings's properties repeatedly, so it shouldn't be destroyed.
There are two other important features.
slowStartDelay property lets stm start the RSVP reader slowly, then lets it gain speed. You can reset to your currently stored slow starting/warmup speed using stm.resetSlowStart().true as the optional second argument to stm.calcDelay() freezes the progress of that speeding up. In future, it may use that boolean to reset the slow starting speed.The functionality to add more delay modifiers after the fact hasn't been created yet.
MIT
Issues reports welcome at https://github.com/knod/string-time/issues.
Pull requests welcome, but please test your code befor making a pull request.
Fork the repo and clone it to your machine
Open the string-time folder in your terminal (or navigate to it in the terminal using cd) and do
npm install
That should install jasmine for testing.
npm test
You can then run npm test whenever you want in order to make sure that the code passes all existing tests. If more tests are needed to support new functionality, please write them. Check out the jasmine API for more details on what you can do. If you're not sure how to write those tests, feel free to file an issues
baseDelay on external .wpm, converting on the fly? Needs recalculating every time.FAQs
Calculates how long a string should stay visible using the characteristics of that string, corresponding millisecond values, and other data
The npm package @knod/string-time receives a total of 7 weekly downloads. As such, @knod/string-time popularity was classified as not popular.
We found that @knod/string-time demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.