Skip to content

Commit

Permalink
Modify to follow the rules of the new 'standard-markdown'
Browse files Browse the repository at this point in the history
Upgrade standard-markdown
  • Loading branch information
abetomo committed Sep 13, 2018
1 parent 2936ad9 commit 08123b6
Show file tree
Hide file tree
Showing 15 changed files with 95 additions and 95 deletions.
12 changes: 6 additions & 6 deletions docs/copy.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ fs.copy('/tmp/mydir', '/tmp/mynewdir', err => {

// With Promises:
fs.copy('/tmp/myfile', '/tmp/mynewfile')
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})

// With async/await:
async function example () {
Expand Down
12 changes: 6 additions & 6 deletions docs/emptyDir.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ fs.emptyDir('/tmp/some/dir', err => {

// With Promises:
fs.emptyDir('/tmp/some/dir')
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})

// With async/await:
async function example () {
Expand Down
24 changes: 12 additions & 12 deletions docs/ensureDir.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ fs.ensureDir(dir, desiredMode, err => {

// With Promises:
fs.ensureDir(dir)
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})

// With Promises and a mode integer:
fs.ensureDir(dir, desiredMode)
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})

// With async/await:
async function example (directory) {
Expand Down
12 changes: 6 additions & 6 deletions docs/ensureFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ fs.ensureFile(file, err => {

// With Promises:
fs.ensureFile(file)
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})

// With async/await:
async function example (f) {
Expand Down
12 changes: 6 additions & 6 deletions docs/ensureLink.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ fs.ensureLink(srcpath, dstpath, err => {

// With Promises:
fs.ensureLink(srcpath, dstpath)
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})

// With async/await:
async function example (src, dest) {
Expand Down
12 changes: 6 additions & 6 deletions docs/ensureSymlink.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ fs.ensureSymlink(srcpath, dstpath, err => {

// With Promises:
fs.ensureSymlink(srcpath, dstpath)
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})

// With async/await:
async function example (src, dest) {
Expand Down
12 changes: 6 additions & 6 deletions docs/move.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ fs.move(srcpath, dstpath, err => {

// With Promises:
fs.move(srcpath, dstpath)
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})

// With async/await:
async function example (src, dest) {
Expand Down
14 changes: 7 additions & 7 deletions docs/outputFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ fs.outputFile(file, 'hello!', err => {

// With Promises:
fs.outputFile(file, 'hello!')
.then(() => fs.readFile(file, 'utf8'))
.then(data => {
console.log(data) // => hello!
})
.catch(err => {
console.error(err)
})
.then(() => fs.readFile(file, 'utf8'))
.then(data => {
console.log(data) // => hello!
})
.catch(err => {
console.error(err)
})

// With async/await:
async function example (f) {
Expand Down
2 changes: 1 addition & 1 deletion docs/outputJson-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Almost the same as [`writeJsonSync`](writeJson-sync.md), except that if the dire
const fs = require('fs-extra')

const file = '/tmp/this/path/does/not/exist/file.json'
fs.outputJsonSync(file, {name: 'JP'})
fs.outputJsonSync(file, { name: 'JP' })

const data = fs.readJsonSync(file)
console.log(data.name) // => JP
Expand Down
20 changes: 10 additions & 10 deletions docs/outputJson.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const fs = require('fs-extra')
const file = '/tmp/this/path/does/not/exist/file.json'

// With a callback:
fs.outputJson(file, {name: 'JP'}, err => {
fs.outputJson(file, { name: 'JP' }, err => {
console.log(err) // => null

fs.readJson(file, (err, data) => {
Expand All @@ -31,19 +31,19 @@ fs.outputJson(file, {name: 'JP'}, err => {
})

// With Promises:
fs.outputJson(file, {name: 'JP'})
.then(() => fs.readJson(file))
.then(data => {
console.log(data.name) // => JP
})
.catch(err => {
console.error(err)
})
fs.outputJson(file, { name: 'JP' })
.then(() => fs.readJson(file))
.then(data => {
console.log(data.name) // => JP
})
.catch(err => {
console.error(err)
})

// With async/await:
async function example (f) {
try {
await fs.outputJson(f, {name: 'JP'})
await fs.outputJson(f, { name: 'JP' })

const data = await fs.readJson(f)

Expand Down
24 changes: 12 additions & 12 deletions docs/readJson.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ fs.readJson('./package.json', (err, packageObj) => {

// With Promises:
fs.readJson('./package.json')
.then(packageObj => {
console.log(packageObj.version) // => 0.1.3
})
.catch(err => {
console.error(err)
})
.then(packageObj => {
console.log(packageObj.version) // => 0.1.3
})
.catch(err => {
console.error(err)
})

// With async/await:
async function example () {
Expand Down Expand Up @@ -64,12 +64,12 @@ fs.readJson(file, { throws: false }, (err, obj) => {

// Wtih Promises:
fs.readJson(file, { throws: false })
.then(obj => {
console.log(obj) // => null
})
.catch(err => {
console.error(err) // Not called
})
.then(obj => {
console.log(obj) // => null
})
.catch(err => {
console.error(err) // Not called
})

// With async/await:
async function example (f) {
Expand Down
12 changes: 6 additions & 6 deletions docs/remove.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ fs.remove('/home/jprichardson', err => {

// With Promises:
fs.remove('/tmp/myfile')
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})

// With async/await:
async function example (src, dest) {
Expand Down
2 changes: 1 addition & 1 deletion docs/writeJson-sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Writes an object to a JSON file.
```js
const fs = require('fs-extra')

fs.writeJsonSync('./package.json', {name: 'fs-extra'})
fs.writeJsonSync('./package.json', { name: 'fs-extra' })
```
---

Expand Down
18 changes: 9 additions & 9 deletions docs/writeJson.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,25 @@ Writes an object to a JSON file.
const fs = require('fs-extra')

// With a callback:
fs.writeJson('./package.json', {name: 'fs-extra'}, err => {
fs.writeJson('./package.json', { name: 'fs-extra' }, err => {
if (err) return console.error(err)

console.log('success!')
})

// With Promises:
fs.writeJson('./package.json', {name: 'fs-extra'})
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})
fs.writeJson('./package.json', { name: 'fs-extra' })
.then(() => {
console.log('success!')
})
.catch(err => {
console.error(err)
})

// With async/await:
async function example () {
try {
await fs.writeJson('./package.json', {name: 'fs-extra'})
await fs.writeJson('./package.json', { name: 'fs-extra' })
console.log('success!')
} catch (err) {
console.error(err)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"secure-random": "^1.1.1",
"semver": "^5.3.0",
"standard": "^12.0.1",
"standard-markdown": "^4.0.1"
"standard-markdown": "^5.0.0"
},
"main": "./lib/index.js",
"scripts": {
Expand Down

0 comments on commit 08123b6

Please sign in to comment.