Move to GitHub Actions

This commit is contained in:
Sindre Sorhus 2020-12-01 14:57:27 +07:00
parent dececa8aa3
commit 5e4f43cf37
5 changed files with 27 additions and 12 deletions

23
.github/workflows/main.yml vendored Normal file
View File

@ -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

View File

@ -1,4 +0,0 @@
language: node_js
node_js:
- '10'
- '8'

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (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: 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:

View File

@ -7,7 +7,7 @@
"author": { "author": {
"name": "Sindre Sorhus", "name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com", "email": "sindresorhus@gmail.com",
"url": "sindresorhus.com" "url": "https://sindresorhus.com"
}, },
"engines": { "engines": {
"node": ">=8" "node": ">=8"

View File

@ -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 > Timeout a promise after a specified amount of time
## Install ## Install
``` ```
$ npm install p-timeout $ npm install p-timeout
``` ```
## Usage ## Usage
```js ```js
@ -22,7 +20,6 @@ pTimeout(delayedPromise, 50).then(() => 'foo');
//=> [TimeoutError: Promise timed out after 50 milliseconds] //=> [TimeoutError: Promise timed out after 50 milliseconds]
``` ```
## API ## API
### pTimeout(input, milliseconds, message?) ### pTimeout(input, milliseconds, message?)
@ -48,7 +45,7 @@ Passing `Infinity` will cause it to never time out.
#### message #### message
Type: `string` `Error`<br> Type: `string | Error`\
Default: `'Promise timed out after 50 milliseconds'` Default: `'Promise timed out after 50 milliseconds'`
Specify a custom error message or error. Specify a custom error message or error.
@ -78,7 +75,6 @@ pTimeout(delayedPromise(), 50, () => {
Exposed for instance checking and sub-classing. Exposed for instance checking and sub-classing.
## Related ## Related
- [delay](https://github.com/sindresorhus/delay) - Delay a promise a specified amount of time - [delay](https://github.com/sindresorhus/delay) - Delay a promise a specified amount of time