Add migration notes.
This commit is contained in:
parent
554ed47ba7
commit
f40ab323dd
25
README.md
25
README.md
@ -27,7 +27,7 @@ PO.load('text.po', function (err, po) {
|
|||||||
node-po is unmaintained and because this library is no longer limited to
|
node-po is unmaintained and because this library is no longer limited to
|
||||||
Node.JS: it works in the browser too.
|
Node.JS: it works in the browser too.
|
||||||
|
|
||||||
Changes compared to node-po:
|
### Changes compared to node-po
|
||||||
|
|
||||||
* Proper handling of async methods that won't crash your Node.JS process when
|
* Proper handling of async methods that won't crash your Node.JS process when
|
||||||
something goes wrong.
|
something goes wrong.
|
||||||
@ -35,6 +35,29 @@ PO.load('text.po', function (err, po) {
|
|||||||
* A test suite.
|
* A test suite.
|
||||||
* Browser support (through Browserified and bower).
|
* Browser support (through Browserified and bower).
|
||||||
|
|
||||||
|
### Migrating from node-po
|
||||||
|
|
||||||
|
You'll need to update the module reference: `require('pofile')` instead of
|
||||||
|
`require('node-po')`.
|
||||||
|
|
||||||
|
At the initial release, node-po and pofile have identical APIs, with one small
|
||||||
|
exception: the `save` and `load` methods now take a callback that has an `err`
|
||||||
|
parameter: `(err)` for `save` and `(err, po)` for `load`. This is similar to
|
||||||
|
Node.JS conventions.
|
||||||
|
|
||||||
|
Change code such as:
|
||||||
|
|
||||||
|
```js
|
||||||
|
PO.load('text.po', function (po) {
|
||||||
|
```
|
||||||
|
|
||||||
|
To:
|
||||||
|
|
||||||
|
```js
|
||||||
|
PO.load('text.po', function (err, po) {
|
||||||
|
// Handle err if needed
|
||||||
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
(The MIT License)
|
(The MIT License)
|
||||||
|
Loading…
Reference in New Issue
Block a user