Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: modernize and fix code examples in fs.md #12035

Closed
wants to merge 7 commits into from
Closed

doc: modernize and fix code examples in fs.md #12035

wants to merge 7 commits into from

Conversation

vsemozhetbyt
Copy link
Contributor

@vsemozhetbyt vsemozhetbyt commented Mar 25, 2017

Checklist
Affected core subsystem(s)

doc, fs

  • unify quotes
  • avoid quote escaping
  • simplify logics (delete unnecessary else after return and throw)
  • concatenation -> template literal
  • add missing callback
  • fix typo
  • update output example

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system. labels Mar 25, 2017
doc/api/fs.md Outdated
@@ -2173,7 +2172,7 @@ Example:
```js
fs.writeFile('message.txt', 'Hello Node.js', (err) => {
if (err) throw err;
console.log('It\'s saved!');
console.log("It's saved!");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the quote can be avoided if the message is something like The file has been saved!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joyeecheung Done)

doc/api/fs.md Outdated
}

throw err;
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: how about removing also this else branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

jasnell pushed a commit that referenced this pull request Mar 27, 2017
* unify quotes in fs.md
* avoid quote escaping in fs.md
* simplify logics in fs.md
* concatenation -> template literal in fs.md
* add missing callback in fs.md
* fix typo in fs.md
* update output example in fs.md

PR-URL: #12035
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell
Copy link
Member

jasnell commented Mar 27, 2017

Landed in 31da375

@jasnell jasnell closed this Mar 27, 2017
@vsemozhetbyt vsemozhetbyt deleted the fs.md branch March 27, 2017 17:48
MylesBorins pushed a commit that referenced this pull request Mar 28, 2017
* unify quotes in fs.md
* avoid quote escaping in fs.md
* simplify logics in fs.md
* concatenation -> template literal in fs.md
* add missing callback in fs.md
* fix typo in fs.md
* update output example in fs.md

PR-URL: #12035
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Mar 28, 2017
@italoacasas italoacasas mentioned this pull request Apr 10, 2017
2 tasks
MylesBorins pushed a commit that referenced this pull request Apr 18, 2017
* unify quotes in fs.md
* avoid quote escaping in fs.md
* simplify logics in fs.md
* concatenation -> template literal in fs.md
* add missing callback in fs.md
* fix typo in fs.md
* update output example in fs.md

PR-URL: #12035
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Apr 19, 2017
* unify quotes in fs.md
* avoid quote escaping in fs.md
* simplify logics in fs.md
* concatenation -> template literal in fs.md
* add missing callback in fs.md
* fix typo in fs.md
* update output example in fs.md

PR-URL: #12035
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Apr 19, 2017
andrew749 pushed a commit to michielbaird/node that referenced this pull request Jul 19, 2017
* unify quotes in fs.md
* avoid quote escaping in fs.md
* simplify logics in fs.md
* concatenation -> template literal in fs.md
* add missing callback in fs.md
* fix typo in fs.md
* update output example in fs.md

PR-URL: nodejs/node#12035
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants