Skip to content

Commit

Permalink
docs: fix code example (#489)
Browse files Browse the repository at this point in the history
* docs: fix code example

* docs: correct data structure for template example
  • Loading branch information
rouanw committed Aug 26, 2021
1 parent 8837534 commit db34970
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,9 @@ Umzug instances provide a `.runAsCLI()` method. When called, this method will au
// migrator.js
const { Umzug } = require('umzug')

exports.umzug = new Umzug({ ... })
const umzug = new Umzug({ ... })

exports.umzug = umzug

if (require.main === module) {
umzug.runAsCLI()
Expand Down Expand Up @@ -717,9 +719,11 @@ You can specify a custom template for your project when constructing an umzug in
```js
const umzug = new Umzug({
migrations: ...,
template: filepath => [
[filepath, fs.readFileSync('path/to/your/template/file').toString()],
]
create: {
template: filepath => [
[filepath, fs.readFileSync('path/to/your/template/file').toString()],
]
}
})
```

Expand Down

0 comments on commit db34970

Please sign in to comment.