Skip to content

Commit

Permalink
use flat badges
Browse files Browse the repository at this point in the history
  • Loading branch information
shinnn committed Jan 1, 2015
1 parent 1a86880 commit fd34ddf
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

[![Build Status](https://travis-ci.org/shinnn/takeout.svg?branch=master)](https://travis-ci.org/shinnn/takeout)
[![Build status](https://ci.appveyor.com/api/projects/status/jcn6afxqfy27y69r?svg=true)](https://ci.appveyor.com/project/ShinnosukeWatanabe/takeout)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/takeout.svg)](https://coveralls.io/r/shinnn/takeout)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/takeout.svg?style=flat)](https://coveralls.io/r/shinnn/takeout)
[![Dependency Status](https://david-dm.org/shinnn/takeout.svg)](https://david-dm.org/shinnn/takeout)
[![devDependency Status](https://david-dm.org/shinnn/takeout/dev-status.svg)](https://david-dm.org/shinnn/takeout#info=devDependencies)

A [Node][node] module to get the file contents, seamlessly available for both local file system and HTTP(S)
A [Node] module to get the file contents, seamlessly available for both local file system and HTTP(S)

```javascript
var takeout = require('takeout');
Expand All @@ -33,9 +33,9 @@ takeout('http://nodejs.org', {encoding: 'utf8'}, function(err, body, res) {

## Installation

[![NPM version](https://badge.fury.io/js/takeout.svg)](https://www.npmjs.org/package/takeout)
[![NPM version](https://img.shields.io/npm/v/takeout.svg?style=flat)](https://www.npmjs.com/package/takeout)

[Use npm](https://www.npmjs.org/doc/cli/npm-install.html).
[Use npm](https://docs.npmjs.com/cli/install).

```sh
npm install takeout
Expand Down Expand Up @@ -69,12 +69,12 @@ takeout('www.npmjs.org', function(err, body, res) {

#### options

In addition to the following, all options for [fs.readFile](http://nodejs.org/api/fs.html#fs_fs_readfile_filename_options_callback) and [http.request](http://nodejs.org/api/http.html#http_http_request_options_callback) are available.
In addition to the following, all options for [fs.readFile](http://nodejs.org/api/fs.html#fs_fs_readfile_filename_options_callback) and [got](https://github.com/sindresorhus/got#options) are available.

##### options.encoding

Type: `String` or `null`
Default: `null` (In other words, the content is returned as a `Buffer` by default.)
Default: `null` (In other words, the content is returned as a [`Buffer`][buffer] by default.)

Directly passed to [fs.readFile](http://nodejs.org/api/fs.html#fs_fs_readfile_filename_options_callback) options or [`setEncoding`](http://nodejs.org/api/stream.html#stream_readable_setencoding_encoding) of the response data.

Expand Down Expand Up @@ -111,12 +111,12 @@ takeout('dist', {directoryIndex: false}, function(err) {
#### callback(*error*, *body*, *response*)

*error*: `Error` if it fails to get the contents, otherwise `null`
*body*: `Buffer` or `String` (according to [`options.encoding`](#optionsencoding))
*body*: [`Buffer`][buffer] or `String` (according to [`options.encoding`](#optionsencoding))
*response*: `Object` ([response object](http://nodejs.org/api/http.html#http_http_incomingmessage)) if the content is got via HTTP(S), otherwise `undefined`

## CLI

You can use this module as a CLI tool by installing it [globally](https://www.npmjs.org/doc/files/npm-folders.html#global-installation).
You can use this module as a CLI tool by installing it [globally](https://docs.npmjs.com/files/folders#global-installation).

```sh
npm install -g takeout
Expand All @@ -129,20 +129,22 @@ Usage1: takeout <file path | URL> --out <dest>
Usage2: takeout <file path | URL> > <dest>

Options:
--out, -o <file path> Write the result to a file (stdout by default)
--encoding, -e <encoding> Set encoding (same as Node's encoding option)
--index, -d <filename> Set the filename of directory index
--no-index, Do not care about directory index
--help, -h Print usage information
--version, -v Print version
--out, -o <file path> Write the result to a file (stdout by default)
--encoding, -e <encoding> Set encoding (same as Node's encoding option)
--index, -d <filename> Set the filename of directory index
--no-index, Do not care about directory index
--timeout, -t <ms> Set time after which the request will be aborted
--help, -h Print usage information
--version, -v Print version
```
You can do almost the same thing with [`cat`](http://tldp.org/LDP/abs/html/basic.html#CATREF) and [`curl`](http://curl.haxx.se/docs/). But this tool works on various environments, as long as they supports [Node][node].
You can do almost the same thing with [`cat`](http://tldp.org/LDP/abs/html/basic.html#CATREF) and [`curl`](http://curl.haxx.se/docs/). But this tool works on various environments, as long as they supports [Node].
## License
Copyright (c) 2014 [Shinnosuke Watanabe](https://github.com/shinnn)
Licensed under [the MIT License](./LICENSE).
[node]: http://nodejs.org/
[buffer]: http://nodejs.org/api/buffer.html#buffer_class_buffer
[Node]: http://nodejs.org/

0 comments on commit fd34ddf

Please sign in to comment.