
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
@tailored-apps/helpers
Advanced tools
A small library providing various utility functions used in tailored apps backends (propably not very useful for anyone else)
@tailored-apps/helpers contains some helper-functions and is part of the api-skeleton-2.
npm install @tailored-apps/helpers
Registers listeners that produce output on process termination
function registerExitListeners (logger, moduleName = 'module')
Returns the difference between two Date objects in seconds - will instantiate a new Date object if no finish parameter is provided.
function getDuration (start, finish)
Replaces tokens in a string with values from the provided "replacements" object
All tokens will be replaced with the values of the corresponding property in the replacements object, if such a property exists (i.e. is not undefined). Otherwise, token literals will be returned.
Returns a string with the tokens replaced.
function replaceTokens (str, replacements, tokenStart = '{', tokenEnd = '}')
Usage
replaceTokens('this {fancyProp} will be replaced, {poorMe} will not', { fancyProp: 'strange thing' })
| input | value |
|---|---|
| str | this {fancyProp} will be replaced, {poorMe} will not |
| replacements | { fancyProp: 'strange thing' } |
| tokenStart | { |
| tokenEnd | } |
returns:
"this strange thing will be replaced, {poorMe} will not"
The simplest of utility functions - will throw an error if NODE_ENV is not set
function requireNodeEnv (errorMessage = 'NODE_ENV environment variable is not set.')
FAQs
A small library providing various utility functions used in tailored apps backends (propably not very useful for anyone else)
We found that @tailored-apps/helpers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.