Research
Recent Trends in Malicious Packages Targeting Discord
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
lie-ts
Advanced tools
Readme
The smallest, quickest TypeScript promise library available.
Forked from the orginal Lie JS promise lib and includes it's own setImmediate polyfill, significantly reducing the effective size compared to the original library.
setImediate
method and uses it. Checks in this order for these methods:setImediate
method attached to window or global object.window.postMessage
is possible, uses an ultra fast messaging method to polyfill setImediate.setTimeout
if everything else fails.Also includes a new special tricK:
new Promise(function(res, rej) {
res(1,2,3);
}).then(function(v1,v2,v3) {
console.log(v1,v2,v3) // <= 1, 2, 3
})
npm install lie-ts
You can also grab the compressed, minified file fom the /dist
folder of this repository.
// Common JS/node
var Promise = require('lie-ts').Promise;
// ES6/ Typescript
import { Promise } from "lie-ts";
// Take over global/window Promise object *if it doesn't exist already*.
Promise.doPolyfill();
You can also just drop the minified lib from the /dist
folder directly into a <script>
tag or load it in with an AMD loader.
Implements the standard ES6 api:
new Promise(function(resolve, reject){
doSomething(function(err, result) {
if (err) {
reject(err);
} else {
resolve(result);
}
});
}).then(function (value) {
//on success
}, function (reason) {
//on error
}).catch(function (reason) {
//shortcut for error handling
});
Promise.all([
//array of promises or values
]).then(function ([/* array of results */]));
Promise.race([
//array of promises or values
]);
// either resolves or rejects depending on the first value to do so
The isomorphic setImmediate polyfill described at the top is exposed as setFast
.
import { setFast } from "lie-ts";
setFast((a, b, c) => {
console.log(a, b, c) // <= "args", "to", "pass"
console.log("This will happen very quickly!")
}, "args", "to", "pass");
In Node.js, lie emits an unhandledRejection
event when a rejected promise isn't caught, in line with how io.js does it. This allows it to act as a promise shim in both Node.js and the browser.
FAQs
The Smallest & Fastest TS Promise lib.
The npm package lie-ts receives a total of 26 weekly downloads. As such, lie-ts popularity was classified as not popular.
We found that lie-ts 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.
Research
The Socket research team breaks down a sampling of malicious packages that download and execute files, among other suspicious behaviors, targeting the popular Discord platform.
Security News
Socket CEO Feross Aboukhadijeh joins a16z partners to discuss how modern, sophisticated supply chain attacks require AI-driven defenses and explore the challenges and solutions in leveraging AI for threat detection early in the development life cycle.
Security News
NIST's new AI Risk Management Framework aims to enhance the security and reliability of generative AI systems and address the unique challenges of malicious AI exploits.