Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@types/lscache
Advanced tools
TypeScript definitions for lscache
npm install --save @types/lscache
This package contains type definitions for lscache (https://github.com/pamelafox/lscache).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/lscache.
interface LSCache {
/**
* Stores the value in localStorage. Expires after specified number of minutes.
* @param {string} key
* @param {Object|string} value
* @param {number} time
* @return true if the value was inserted successfully
*/
set(key: string, value: any, time?: number): boolean;
/**
* Retrieves specified value from localStorage, if not expired.
* @param {string} key
* @return {string|Object}
*/
get(key: string): any;
/**
* Removes a value from localStorage.
* Equivalent to 'delete' in memcache, but that's a keyword in JS.
* @param {string} key
*/
remove(key: string): void;
/**
* Returns whether local storage is supported.
* Currently exposed for testing purposes.
* @return {boolean}
*/
supported(): boolean;
/**
* Flushes all lscache items and expiry markers without affecting rest of localStorage
*/
flush(): void;
/**
* Flushes expired lscache items and expiry markers without affecting rest of localStorage
*/
flushExpired(): void;
/**
* Appends CACHE_PREFIX so lscache will partition data in to different buckets.
* @param {string} bucket
*/
setBucket(bucket: string): void;
/**
* Resets the string being appended to CACHE_PREFIX so lscache will use the default storage behavior.
*/
resetBucket(): void;
/**
* @returns {number} The currently set number of milliseconds each time unit represents in
* the set() function's "time" argument.
*/
getExpiryMilliseconds(): number;
/**
* Sets the number of milliseconds each time unit represents in the set() function's
* "time" argument.
* Sample values:
* 1: each time unit = 1 millisecond
* 1000: each time unit = 1 second
* 60000: each time unit = 1 minute (Default value)
* 360000: each time unit = 1 hour
* @param {number} milliseconds
*/
setExpiryMilliseconds(milliseconds: number): void;
/**
* Sets whether to display warnings when an item is removed from the cache or not.
*/
enableWarnings(enabled: boolean): void;
}
declare var lscache: LSCache;
declare module "lscache" {
var lscache: LSCache;
export = lscache;
}
These definitions were written by c-py.
FAQs
TypeScript definitions for lscache
The npm package @types/lscache receives a total of 8,425 weekly downloads. As such, @types/lscache popularity was classified as popular.
We found that @types/lscache 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.