https://github.com/arshadkazmi42/cookie-url
Generate cookie url using cookie object
https://github.com/arshadkazmi42/cookie-url
browser-extension chrome cookie domain firefox url
Last synced: about 1 month ago
JSON representation
Generate cookie url using cookie object
- Host: GitHub
- URL: https://github.com/arshadkazmi42/cookie-url
- Owner: arshadkazmi42
- License: mit
- Created: 2019-12-02T17:36:39.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-07-12T12:26:25.000Z (almost 4 years ago)
- Last Synced: 2025-09-16T14:17:11.325Z (9 months ago)
- Topics: browser-extension, chrome, cookie, domain, firefox, url
- Language: JavaScript
- Homepage:
- Size: 167 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# cookie-url
[](https://github.com/arshadkazmi42/cookie-url/actions/workflows/nodejs.yml)
[](https://www.npmjs.com/package/cookie-url)
[](https://www.npmjs.com/package/cookie-url)
[](https://github.com/arshadkazmi42/cookie-url)
[](https://github.com/arshadkazmi42/cookie-url/blob/master/LICENSE)
[](https://github.com/arshadkazmi42/cookie-url/graphs/contributors)
[](https://github.com/arshadkazmi42/cookie-url/commits/master)
Generate browser cookie url from cookie object. Supports [Chrome Cookie](https://developer.chrome.com/extensions/cookies#type-Cookie) & [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/cookies/Cookie#Type)
## Install
```
npm i cookie-url
```
## Usage
```javascript
const CookieURL = require('cookie-url');
const cookie = {
secure: false,
domain: '.github.com',
path: '/arshadkazmi42'
};
console.log(CookieURL(cookie));
// OUTPUT
// http://github.com/arshadkazmi42
const cookie = {
secure: true,
domain: '.github.com',
path: '/arshadkazmi42'
};
console.log(CookieURL(cookie));
// OUTPUT
// https://github.com/arshadkazmi42
const cookie = {
secure: true,
domain: '.github.com',
path: '/arshadkazmi42'
};
console.log(CookieURL(cookie, true /* withWWWPrefix */));
// OUTPUT
// https://www.github.com/arshadkazmi42
const cookie = {
secure: true,
domain: '.www.github.com',
path: '/arshadkazmi42'
};
console.log(CookieURL(cookie, true /* withWWWPrefix */));
// OUTPUT
// https://www.github.com/arshadkazmi42
```
## Contributing
Interested in contributing to this project?
You can log any issues or suggestion related to this library [here](https://github.com/arshadkazmi42/cookie-url/issues/new)
Read our contributing [guide](CONTRIBUTING.md) on getting started with contributing to the codebase