fake-cookie
v1.0.4
Published
Simulate reading and writing browser cookies
Downloads
35
Readme
fake-cookie
Node.js module to simulate reading and writing browser cookie.
Use from JavaScript:
var fc = require('fake-cookie');
fc.cookie('cookie_name', 'cookie_value');
fc.cookie('cookie_name'); // ==> 'cookie_value'
fc.getCookies(); // ==> ['cookie_name=>cookie_value']
fc.count; // ==> 1
fc.removeCookie('cookie_name');
fc.count; // ==> 0
Use from TypeScript:
/// <reference path="typings/fake-cookie.d.ts" />
import fc = require('fake-cookie');
fc.cookie('cookie_name', 'cookie_value');
fc.cookie('cookie_name'); // ==> 'cookie_value'
fc.getCookies(); // ==> ['cookie_name=>cookie_value']
fc.count; // ==> 1
fc.removeCookie('cookie_name');
fc.count; // ==> 0