Skip to content

Instantly share code, notes, and snippets.

@gjtorikian
Created February 12, 2012 17:27
Show Gist options
  • Save gjtorikian/1809799 to your computer and use it in GitHub Desktop.
Save gjtorikian/1809799 to your computer and use it in GitHub Desktop.
API Markdown styles
## 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
@isaacs
Copy link

isaacs commented Feb 14, 2012

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