From 5e4f43cf37e156a4c8c9ea3280babae6b1dcbb91 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 1 Dec 2020 14:57:27 +0700 Subject: [PATCH] Move to GitHub Actions --- .github/workflows/main.yml | 23 +++++++++++++++++++++++ .travis.yml | 4 ---- license | 2 +- package.json | 2 +- readme.md | 8 ++------ 5 files changed, 27 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..18531b3 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,23 @@ +name: CI +on: + - push + - pull_request +jobs: + test: + name: Node.js ${{ matrix.node-version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + node-version: + - 14 + - 12 + - 10 + - 8 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm install + - run: npm test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f3fa8cd..0000000 --- a/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - '10' - - '8' diff --git a/license b/license index e7af2f7..fa7ceba 100644 --- a/license +++ b/license @@ -1,6 +1,6 @@ MIT License -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) Sindre Sorhus (https://sindresorhus.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: diff --git a/package.json b/package.json index bf503cd..0c8b4c3 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" + "url": "https://sindresorhus.com" }, "engines": { "node": ">=8" diff --git a/readme.md b/readme.md index ad4ab52..3bf13f3 100644 --- a/readme.md +++ b/readme.md @@ -1,15 +1,13 @@ -# p-timeout [![Build Status](https://travis-ci.org/sindresorhus/p-timeout.svg?branch=master)](https://travis-ci.org/sindresorhus/p-timeout) +# p-timeout > Timeout a promise after a specified amount of time - ## Install ``` $ npm install p-timeout ``` - ## Usage ```js @@ -22,7 +20,6 @@ pTimeout(delayedPromise, 50).then(() => 'foo'); //=> [TimeoutError: Promise timed out after 50 milliseconds] ``` - ## API ### pTimeout(input, milliseconds, message?) @@ -48,7 +45,7 @@ Passing `Infinity` will cause it to never time out. #### message -Type: `string` `Error`
+Type: `string | Error`\ Default: `'Promise timed out after 50 milliseconds'` Specify a custom error message or error. @@ -78,7 +75,6 @@ pTimeout(delayedPromise(), 50, () => { Exposed for instance checking and sub-classing. - ## Related - [delay](https://github.com/sindresorhus/delay) - Delay a promise a specified amount of time