Created
February 12, 2012 17:27
-
-
Save gjtorikian/1809799 to your computer and use it in GitHub Desktop.
API Markdown styles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## readFileSync(filename, [encoding]) | |
* `filename` String, Required. The name of the file to read | |
* `encoding` String, Optional. The encoding to use | |
* Returns: String or Buffer. The contents of the filename. If `encoding` is specified, then this function returns a string. Otherwise it returns a `buffer`. | |
* * * | |
## fs.readFileSync(filename, [encoding='utf8']) -> String | Buffer | |
- filename (String): The name of the file to read | |
- encoding (String): The encoding to use | |
#### Returns | |
The contents of the `filename`. If `encoding` is specified, then this function returns a string. Otherwise it returns a [[buffer buffer]]. | |
* * * | |
## fs.writeFile(filename, data, [encoding], [callback]) -> Void | |
- filename String. The name of the file to write to | |
- data String or buffer, default is 'utf8'. The data to write (this can be a string or a buffer) | |
- encoding String. The encoding to use (this is ignored if `data` is a buffer) | |
- callback Function. An optional callback to execute once the function completes | |
fs.writeFile(filename, data, [encoding='utf8'], [callback()]) -> Void | |
- filename (String): The name of the file to write to | |
- data (String | buffer): The data to write (this can be a string or a buffer) | |
- encoding (String): The encoding to use (this is ignored if `data` is a buffer) | |
- callback (Function): An optional callback to execute once the function completes |
I think at one point you indented the args into another ul, no?
## fs.writeFile(filename, data, [encoding = 'utf8'], [callback])
* filename {String} The name of the file to write to
* data {String | Buffer} The data to write (this can be a string or a buffer)
* encoding {String} The encoding to use (this is ignored if `data` is a buffer)
* callback {Function} An optional callback to execute once the function completes
* err {Error} The standard error object
Ideally the parser,when rendering the HTML, will plug in the child UL back into the signature: fs.writeFile(filename, data, [encoding = 'utf8'], [callback(err)])
.
I hadn't suggested indenting the args into a child UL, no, but that's a good idea. The trick then would be for us to perhaps just treat a child list differently based on the type of the parent.
parent is a... >> list is...
event >> arguments
function >> arguments (and return?)
object >> child fields
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Another option:
Another open question: how should we express the arguments passed to a callback? It's not quite a
return
orthrows
, but sort of similar.