Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey committed Jun 11, 2019
0 parents commit f4f4221
Show file tree
Hide file tree
Showing 11 changed files with 8,164 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# EditorConfig is awesome: http://EditorConfig.org

root = true

[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.DS_Store
.vscode
coverage/
node_modules/
npm-debug.log
dist/
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sudo: false
language: node_js

notifications:
email:
on_success: never
on_failure: change

node_js:
- "8"
- stable

after_script: "npm install coveralls@2 && cat ./coverage/lcov.info | coveralls"
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2019 Blake Embrey (hello@blakeembrey.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Popsicle Redirects

[![NPM version][npm-image]][npm-url]
[![NPM downloads][downloads-image]][downloads-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]

> Popsicle middleware for following HTTP redirects.
## Installation

```
npm install popsicle-redirects --save
```

## Usage

```js
import { redirects } from "popsicle-redirects";

const middleware = redirects(transport());
```

### Options

* `fn` Wrap a [`throwback`](https://github.com/serviejs/throwback) compatible middleware function in redirect behavior
* `maxRedirects` Set the maximum number of redirects to attempt before throwing an error (default: `5`)
* `confirmRedirect` Confirmation function for following 307 and 308 non-idempotent redirects (default: `() => false`)

## TypeScript

This project is written using [TypeScript](https://github.com/Microsoft/TypeScript) and publishes the definitions directly to NPM.

## License

MIT

[npm-image]: https://img.shields.io/npm/v/popsicle-redirects.svg?style=flat
[npm-url]: https://npmjs.org/package/popsicle-redirects
[downloads-image]: https://img.shields.io/npm/dm/popsicle-redirects.svg?style=flat
[downloads-url]: https://npmjs.org/package/popsicle-redirects
[travis-image]: https://img.shields.io/travis/serviejs/popsicle-redirects.svg?style=flat
[travis-url]: https://travis-ci.org/serviejs/popsicle-redirects
[coveralls-image]: https://img.shields.io/coveralls/serviejs/popsicle-redirects.svg?style=flat
[coveralls-url]: https://coveralls.io/r/serviejs/popsicle-redirects?branch=master
Loading

0 comments on commit f4f4221

Please sign in to comment.