Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@types/cookie_js
Advanced tools
TypeScript definitions for cookie_js
npm install --save @types/cookie_js
This package contains type definitions for cookie_js (https://github.com/florian/cookie.js).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cookie_js.
declare module "cookie_js" {
export = cookie;
}
/**
* https://github.com/DefinitelyTyped/DefinitelyTyped/pull/16025#issuecomment-295784660
*/
declare module "cookiejs" {
export = cookie;
}
declare function cookie(key: string, fallback?: string): string;
declare function cookie(keys: string[], fallback?: string): string;
interface UtilStatic {
isArray: (value: any) => boolean;
isObject: (value: any) => boolean;
toArray: (...args: any[]) => any[];
getKeys: (value: {}) => any[];
encode: (value: string) => string;
decode: (value: string) => string;
retrieve: (x: string, y: string) => string;
}
interface Options {
expires: number | string | Date;
domain: string;
path: string;
secure: boolean;
}
declare namespace cookie {
/**
* Create a cookie. The value will automatically be escaped.
*/
export function set(key: string, value: string, options?: any): void;
/**
* Set several cookies at once
*/
export function set(obj: any, options?: any): void;
/**
* Remove cookies
*/
export function remove(key: string): void;
export function remove(keys: string[]): void;
export function remove(...args: string[]): void;
/**
* Remove cookies that were set with custom options (e.g. specifing domain or path)
*/
export function removeSpecific(key: string, options?: any): void;
export function removeSpecific(keys: string[], options?: any): void;
/**
* Remove all cookies
*/
export function empty(): void;
/**
* Retrieve the value of the cookie
*/
export function get(key: string, fallback?: string): string;
/**
* Retrieve values of several cookies
*/
export function get(keys: string[], fallback?: string): any;
/**
* Get all currently saved cookies
*/
export function all(): any;
/**
* Test if cookies are enabled
*/
export function enabled(): boolean;
/**
* Utility methods
*/
export var utils: UtilStatic;
/**
* Set default options
*/
export var defaults: Options;
}
These definitions were written by slawiko.
FAQs
TypeScript definitions for cookie_js
The npm package @types/cookie_js receives a total of 5,448 weekly downloads. As such, @types/cookie_js popularity was classified as popular.
We found that @types/cookie_js 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.