
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@homeofthings/node-utils
Advanced tools
HomeOfThings - Node Utils: various utilities and common types
AsyncContext<T>
: little wrapper around AsyncLocalStorage
providing default value
asyncContext = new AsyncContext(defaultContext);
...
asyncContext.set(newContext)
...
currentContext = asyncContext.get();
ConfigService
: singleton service based on node-config
configService = new ConfigService({ configDirectory: 'path/to/config' });
then use one of the methods provided by the ConfigService
:
export declare class ConfigService {
readonly configDirectory: string;
readonly environment: string;
constructor(_opts: ConfigOptions);
getConfig(key: string): object | undefined;
reloadConfig(): void;
getString(key: string, defaultValue: string): string;
getNumber(key: string, defaultValue: number): number;
getBoolean(key: string, defaultValue: boolean): boolean;
getObject(key: string, defaultValue: object): object;
// resolve path relative to config-directory
getPath(key: string, defaultValue: string): string;
getOptionalString(key: string): string | undefined;
getOptionalNumber(key: string): number | undefined;
getOptionalBoolean(key: string): boolean | undefined;
getOptionalObject(key: string): object | undefined;
// resolve path relative to config-directory
getOptionalPath(key: string): string | undefined;
}
reload on SIGHUP:
process.on('SIGHUP', () => ConfigService.getInstance().reloadConfig());
LruCache<T>
: LRU cache
cache = new LruCache<UserSession, number>(SESSION_CACHE_SIZE);
cache.set(id, userSession); // add this to the cache and mark it as least recently used
...
cache.get(anotherId); // if it is available in the cache it will be marked as least recently used
sequentialize
: run Promises
in sequence
await sequentialize(item.map(() => doWork(item)));
wait
: wait until a condition is true or timed out
await wait(condition); // polls until condition is true
await wait(condition, 1000); // polls until condition is true or timed out after 1000ms
WritableStrings
: a Writable
for writing to a string array
quoteArgs
and quoteArg
: quote arguments for better readability (e.g. for logging)
FAQs
HomeOfThings - Node Utils: various utilities and common types
The npm package @homeofthings/node-utils receives a total of 20 weekly downloads. As such, @homeofthings/node-utils popularity was classified as not popular.
We found that @homeofthings/node-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.