Skip to content

Commit

Permalink
minor grammatical changes to the README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Wall authored and Charles Wall committed Mar 3, 2017
1 parent 7dd7254 commit 158771f
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ JS-YAML - YAML 1.2 parser / writer for JavaScript
__[Online Demo](http://nodeca.github.com/js-yaml/)__


This is an implementation of [YAML](http://yaml.org/), a human friendly data
This is an implementation of [YAML](http://yaml.org/), a human-friendly data
serialization language. Started as [PyYAML](http://pyyaml.org/) port, it was
completely rewritten from scratch. Now it's very fast, and supports 1.2 spec.

Expand Down Expand Up @@ -57,7 +57,7 @@ var doc = jsyaml.load('greeting: hello\nname: world');
</script>
```

Browser support was done mostly for online demo. If you find any errors - feel
Browser support was done mostly for the online demo. If you find any errors - feel
free to send pull requests with fixes. Also note, that IE and other old browsers
needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate.

Expand Down Expand Up @@ -122,17 +122,17 @@ NOTE: This function **does not** understand multi-document sources, it throws
exception on those.

NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions.
So, JSON schema is not as strict as defined in the YAML specification.
So, the JSON schema is not as strictly defined in the YAML specification.
It allows numbers in any notation, use `Null` and `NULL` as `null`, etc.
Core schema also has no such restrictions. It allows binary notation for integers.
The core schema also has no such restrictions. It allows binary notation for integers.


### load (string [ , options ])

**Use with care with untrusted sources**. The same as `safeLoad()` but uses
`DEFAULT_FULL_SCHEMA` by default - adds some JavaScript-specific types:
`!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources you
must additionally validate object structure, to avoid injections:
`!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources, you
must additionally validate object structure to avoid injections:

``` javascript
var untrusted_code = '"toString": !<tag:yaml.org,2002:js/function> "function (){very_evil_thing();}"';
Expand All @@ -144,7 +144,7 @@ require('js-yaml').load(untrusted_code) + ''

### safeLoadAll (string, iterator [ , options ])

Same as `safeLoad()`, but understands multi-document sources and apply
Same as `safeLoad()`, but understands multi-document sources and applies
`iterator` to each document.

``` javascript
Expand All @@ -163,9 +163,9 @@ Same as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default.

### safeDump (object [ , options ])

Serializes `object` as YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will
throw exception if you try to dump regexps or functions. However, you can
disable exceptions by `skipInvalid` option.
Serializes `object` as a YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will
throw an exception if you try to dump regexps or functions. However, you can
disable exceptions by setting the `skipInvalid` option to `true`.

options:

Expand Down Expand Up @@ -204,7 +204,7 @@ ouput is shown on the right side after `=>` (default setting) or `->`:
"lowercase" => "true", "false"
"uppercase" -> "TRUE", "FALSE"
"camelcase" -> "True", "False"
!!float
"lowercase" => ".nan", '.inf'
"uppercase" -> ".NAN", '.INF'
Expand All @@ -219,7 +219,7 @@ safeDump (object, {
'!!null': 'canonical' // dump null as ~
},
'sortKeys': true // sort object keys
}
});
```

### dump (object [ , options ])
Expand Down Expand Up @@ -261,7 +261,7 @@ Caveats
-------

Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects
or array as keys, and stringifies (by calling .toString method) them at the
or arrays as keys, and stringifies (by calling .toString method) them at the
moment of adding them.

``` yaml
Expand Down Expand Up @@ -293,14 +293,14 @@ Breaking changes in 2.x.x -> 3.x.x
----------------------------------

If you have not used __custom__ tags or loader classes and not loaded yaml
files via `require()` - no changes needed. Just upgrade library.
files via `require()`, no changes are needed. Just upgrade the library.

Otherwise, you should:

1. Replace all occurences of `require('xxxx.yml')` by `fs.readFileSync()` +
`yaml.safeLoad()`.
2. rewrite your custom tags constructors and custom loader
classes, to conform new API. See
classes, to conform the new API. See
[examples](https://github.com/nodeca/js-yaml/tree/master/examples) and
[wiki](https://github.com/nodeca/js-yaml/wiki) for details.

Expand Down

0 comments on commit 158771f

Please sign in to comment.