
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
abort-controller-timer
Advanced tools
An AbortController that aborts after a specified timeout
yarn add abort-controller-timer abort-controller
yarn-tool add abort-controller-timer abort-controller
yt add abort-controller-timer abort-controller
import AbortControllerTimer from 'abort-controller-timer';
test(`base`, (done) =>
{
expect.assertions(8);
let start = Date.now();
let timeout = 100;
let actual = new AbortControllerTimer(timeout);
actual.on('abort', () => {
let d = Date.now() - start;
console.dir(d);
expect(d).toBeGreaterThanOrEqual(100);
expect(d).toBeLessThanOrEqual(110);
})
setTimeout(() => {
expect(actual.aborted).toBeFalsy();
expect(actual.timer).toBeTruthy()
}, 70);
setTimeout(() => expect(actual.aborted).toBeTruthy(), 100);
setTimeout(() => expect(actual.aborted).toBeTruthy(), 150);
setTimeout(() =>
{
expect(actual.aborted).toBeTruthy();
done();
}, 200);
expect(actual).toHaveProperty('ms', timeout);
});
test(`refresh`, (done) =>
{
expect.assertions(12);
let start = Date.now();
let timeout = 100;
let actual = new AbortControllerTimer(timeout);
actual.on('abort', () => {
let d = Date.now() - start;
console.dir(d);
expect(d).toBeGreaterThanOrEqual(170);
expect(d).toBeLessThanOrEqual(180);
})
setTimeout(() => {
expect(Date.now() - start).toBeGreaterThanOrEqual(70);
expect(actual.aborted).toBeFalsy();
expect(actual.refresh()).toBeTruthy()
}, 70);
setTimeout(() => {
expect(Date.now() - start).toBeGreaterThanOrEqual(100);
expect(actual.aborted).toBeFalsy()
}, 100);
setTimeout(() => {
expect(Date.now() - start).toBeGreaterThanOrEqual(150);
expect(actual.aborted).toBeFalsy()
}, 150);
setTimeout(() =>
{
expect(Date.now() - start).toBeGreaterThanOrEqual(200);
expect(actual.aborted).toBeTruthy();
done();
}, 200);
expect(actual).toHaveProperty('ms', timeout);
});
FAQs
An AbortController that aborts after a specified timeout
The npm package abort-controller-timer receives a total of 9 weekly downloads. As such, abort-controller-timer popularity was classified as not popular.
We found that abort-controller-timer 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
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.