Skip to content

Commit

Permalink
chore: use automd
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Mar 29, 2024
1 parent ca6ba07 commit bcf66c0
Show file tree
Hide file tree
Showing 3 changed files with 284 additions and 7 deletions.
47 changes: 41 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,67 @@

# cookie-es

[![bundle size](https://flat.badgen.net/bundlephobia/minzip/cookie-es)](https://bundlephobia.com/package/cookie-es)
<!-- automd:badges bundlejs -->

[![npm version](https://img.shields.io/npm/v/cookie-es)](https://npmjs.com/package/cookie-es)
[![npm downloads](https://img.shields.io/npm/dm/cookie-es)](https://npmjs.com/package/cookie-es)
[![bundle size](https://img.shields.io/bundlejs/size/cookie-es)](https://bundlejs.com/?q=cookie-es)

<!-- /automd -->

ESM build of [cookie](https://www.npmjs.com/package/cookie) with bundled types.

## Usage

Install:

<!-- automd:pm-install -->

```sh
# ✨ Auto-detect
npx nypm install cookie-es

# npm
npm i cookie-es
npm install cookie-es

# yarn
yarn add cookie-es

# pnpm
pnpm install cookie-es

# bun
bun install cookie-es
```

<!-- /automd-->

Import:


<!-- automd:jsimport cdn cjs src=./src/index.ts -->

**ESM** (Node.js, Bun)

```js
// ESM
import { parse, serialize } from 'cookie-es'
import { parse, serialize } from "cookie-es";
```

**CommonJS** (Legacy Node.js)

// CommonJS
const { parse, serialize } = require('cookie-es')
```js
const { parse, serialize } = require("cookie-es");
```

**CDN** (Deno, Bun and Browsers)

```js
import { parse, serialize } from "https://esm.sh/cookie-es";
```

<!-- /automd -->


## License

[MIT](./LICENSE)
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
"build": "unbuild",
"dev": "vitest",
"lint": "eslint --cache --ext .ts,.js,.mjs,.cjs . && prettier -c src test",
"lint:fix": "eslint --cache --ext .ts,.js,.mjs,.cjs . --fix && prettier -c src test -w",
"lint:fix": "automd && eslint --cache --ext .ts,.js,.mjs,.cjs . --fix && prettier -c src test -w",
"release": "pnpm test && pnpm build && changelogen --release --push && npm publish",
"test": "pnpm lint && vitest run --coverage"
},
"devDependencies": {
"@vitest/coverage-v8": "^1.4.0",
"automd": "^0.3.7",
"changelogen": "^0.5.5",
"eslint": "^8.57.0",
"eslint-config-unjs": "^0.2.1",
Expand Down
Loading

0 comments on commit bcf66c0

Please sign in to comment.