Skip to content

Commit 14d0f0c

Browse files
Docs enhancement
1 parent 8fed588 commit 14d0f0c

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

‎README.md‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ Include the script (unless you are packaging scripts somehow else):
2929
**Do not include the script directly from GitHub (http://raw.github.com/...).** The file is being served as text/plain and as such being blocked
3030
in Internet Explorer on Windows 7 for instance (because of the wrong MIME type). Bottom line: GitHub is not a CDN.
3131

32-
js-cookie supports [npm](https://www.npmjs.com/) and [Bower](http://bower.io/) under the name `js-cookie`
32+
js-cookie supports [npm](https://www.npmjs.com/package/js-cookie) and [Bower](http://bower.io/search/?q=js-cookie) under the name `js-cookie`
3333

3434
It can also be loaded as an AMD or CommonJS module.
3535

3636
## Basic Usage
3737

38-
Create a session cookie, valid to the current page:
38+
Create a session cookie, valid to the path of the current page:
3939

4040
```javascript
4141
Cookies.set('name', 'value');
4242
```
4343

44-
Create a cookie that expires 7 days from now, valid to the current page:
44+
Create a cookie that expires 7 days from now, valid to the path of the current page:
4545

4646
```javascript
4747
Cookies.set('name', 'value', { expires: 7 });
@@ -93,9 +93,9 @@ Cookies2.set('name', 'value');
9393

9494
## JSON
9595

96-
js-cookie provides automatic JSON storage for cookies.
96+
js-cookie provides unobstrusive JSON storage for cookies.
9797

98-
When creating a cookie you can pass an Array or Object Literal instead of a string in the value. If you do so, js-cookie store the string representation of the object according to the `JSON.stringify` api (if available):
98+
When creating a cookie you can pass an Array or Object Literal instead of a string in the value. If you do so, js-cookie store the string representation of the object according to the `JSON.stringify` api:
9999

100100
```javascript
101101
Cookies.set('name', { foo: 'bar' });
@@ -111,7 +111,7 @@ Cookies.get('name'); // => '{"foo":"bar"}'
111111
Cookies.get(); // => { name: '{"foo":"bar"}' }
112112
```
113113

114-
When reading a cookie with the `Cookies.getJSON` api, you receive the parsed representation of the string stored in the cookie according to the `JSON.stringify` api (if available):
114+
When reading a cookie with the `Cookies.getJSON` api, you receive the parsed representation of the string stored in the cookie according to the `JSON.stringify` api:
115115

116116
```javascript
117117
Cookies.getJSON('name'); // => { foo: 'bar' }
@@ -125,8 +125,8 @@ Cookies.getJSON(); // => { name: { foo: 'bar' } }
125125

126126
## Encoding
127127

128-
This project is [RFC 6265](http://tools.ietf.org/html/rfc6265#section-4.1.1) compliant. All special characters that are not allowed in the cookie-name or cookie-value are encoded with each one's UTF-8 Hex equivalent.
129-
The only character in cookie-name or cookie-value that is allowed and still encoded is the percent `%` character, it is escaped in order to interpret the input as literal.
128+
This project is [RFC 6265](http://tools.ietf.org/html/rfc6265#section-4.1.1) compliant. All special characters that are not allowed in the cookie-name or cookie-value are encoded with each one's UTF-8 Hex equivalent using [percent-encoding](http://en.wikipedia.org/wiki/Percent-encoding).
129+
The only character in cookie-name or cookie-value that is allowed and still encoded is the percent `%` character, it is escaped in order to interpret percent input as literal.
130130
To override the default cookie decoding you need to use a [converter](#converter).
131131

132132
## Cookie Attributes
@@ -186,13 +186,13 @@ Cookies.get('name'); // => undefined (need to read at 'sub.domain.com')
186186

187187
A `Boolean` indicating if the cookie transmission requires a secure protocol (https)
188188

189-
**Browser default:** Doesn't require secure protocol
189+
**Browser default:** No secure protocol requirement
190190

191191
**Examples:**
192192

193193
```javascript
194194
Cookies.set('name', 'value', { secure: true });
195-
Cookies.get('name'); // => 'value' (if already in secure protocol)
195+
Cookies.get('name'); // => 'value'
196196
Cookies.remove('name', { secure: true });
197197
```
198198

0 commit comments

Comments
 (0)