Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@prodo-ai/js-strings
Advanced tools
Utility library for handling async/await.
Turns a function that accepts a node-style callback into one that returns a Promise
:
import {denodeify} from "@prodo-ai/js-async";
const nodeStyleFunction = (arg1, arg2, callback) => {
if (arg1 == null) {
callback(new Error("Must specify `arg1`."));
}
callback(null, arg1 + arg2);
}
const asyncFunction = denodeify(nodeStyleFunction);
asyncFunction(1, 2)
.then(console.log)
.catch(console.error);
The same as denodeify
, but without error handling. Probably don't use this.
Keeps attempting a behaviour until it succeeds:
import {keepTrying} from "@prodo-ai/js-async";
const result = await keepTrying({
behaviour: () => service.getResult()
});
You can also pass additional parameters for greater control:
until
- a predicate that can be used to determine success. By default, this predicate just checks if the result is non-null.ignoreErrors
- if false
, gives up trying after an error is thrown.timeout
- a timeout, after which an Error
is thrown.inbetweenAttempts
- a callback that is executed between each attempt.Waits until a predicate passes:
import {waitUntil} from "@prodo-ai/js-async";
import {duration, SECOND} from "@prodo-ai/js-timing";
waitUntil({
condition: async () => (await service.getStatus()) === "OK",
pauseTime: duration(1, SECOND),
}).then(service.getResult);
You can also pass additional parameters for greater control:
timeout
- a timeout, after which an Error
is thrown.Owner: Prodo Tech Ltd
Maintainer: tdawes
License: UNLICENSED (for now)
FAQs
JS utilities for strings
The npm package @prodo-ai/js-strings receives a total of 1 weekly downloads. As such, @prodo-ai/js-strings popularity was classified as not popular.
We found that @prodo-ai/js-strings demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.