@mherod/get-cookie v4.2.2
get-cookie ๐ช
Tired of manually copying cookies for API testing? get-cookie extracts authentication cookies directly from Chrome, Firefox, and Safari - perfect for testing, debugging, and automation.
Quick Start ๐
# Install globally
pnpm add -g @mherod/get-cookie
# Get a cookie
get-cookie auth example.com
# Get all cookies for a domain
get-cookie % example.com// Node.js usage
import { getCookie } from "@mherod/get-cookie";
const cookies = await getCookie({
name: "auth",
domain: "example.com",
});โ ๏ธ Platform Support:
- Chrome: macOS only
- Firefox: macOS and Linux
- Safari: macOS only
Installation ๐ฆ
pnpm add @mherod/get-cookie # recommended
npm install @mherod/get-cookie # or npm
yarn add @mherod/get-cookie # or yarnCommon Use Cases ๐ฏ
- ๐ Get auth cookies for API testing
- ๐ Debug cookie issues across browsers
- ๐ค Automate cookie extraction
- ๐งช Use real cookies in integration tests
Basic Usage Examples ๐ก
CLI
# Get specific cookie
get-cookie auth example.com
# Pretty print
get-cookie auth example.com --render
# From URL
get-cookie --url https://example.com/pathNode.js
import { getCookie, type CookieSpec } from "@mherod/get-cookie";
try {
// Get specific cookie
const authCookie = await getCookie({
name: "auth",
domain: "example.com",
});
// Get multiple cookies
const cookies = await getCookie({
name: "%", // all cookies
domain: "example.com",
});
} catch (error) {
console.error("Failed:", error);
}Features โจ
- ๐ Multi-Browser Support:
- Chrome (macOS)
- Firefox (macOS, Linux)
- Safari (macOS)
- ๐ Secure: Browser-specific encryption handling
- ๐ TypeScript Ready: Full type safety with exported type definitions
- ๐ฏ Flexible Querying: Search by name, domain, or use wildcards
- ๐ Multiple Output Formats: JSON, rendered, or grouped results
- ๐ฅ Profile Support: Chrome and Firefox multi-profile support
โ ๏ธ Note: Platform support varies by browser. See our Platform Support Guide for details.
Output Formats ๐
The CLI supports various output formats:
# Default output (just values)
get-cookie auth example.com
# JSON output
get-cookie auth example.com --output json
# Rendered output (human-readable)
get-cookie auth example.com --render
# Grouped by browser/profile
get-cookie auth example.com --dump-groupedDocumentation ๐
Full docs at mherod.github.io/get-cookie
- API Reference
- Advanced Usage
- TypeScript Types
- Security Guide โ ๏ธ
Contributing ๐ค
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
License ๐
This project is licensed under the MIT License - see the LICENSE file for details.
Known Limitations ๐ง
For a comprehensive list of limitations and known issues, please see our Known Limitations Guide.
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago