From 352b1eaa5e895d97f8f07a60387602a2072d1ade Mon Sep 17 00:00:00 2001 From: Adrian Calinescu Date: Tue, 21 Apr 2020 12:42:08 +0300 Subject: [PATCH] Reintroduce Node 8.x support (#79) * Fix Node 8.x support * Add Node 8.x to CI build matrix --- .github/workflows/build.yaml | 2 +- README.md | 2 +- src/destreamer.ts | 3 ++- tsconfig.json | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7ac3f3e..f69eca0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - node-version: [10.x, 12.x, 13.x] + node-version: [8.x, 10.x, 12.x, 13.x] steps: - uses: actions/checkout@v1 diff --git a/README.md b/README.md index 9fd6bdb..fe47d43 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Hopefully this doesn't break the end user agreement for Microsoft Stream. Since ## Prereqs -- **Node.js**: You'll need Node.js v10 or higher. A GitHub Action runs tests on all major Node versions on every commit. +- **Node.js**: You'll need Node.js version 8.0 or higher. A GitHub Action runs tests on all major Node versions on every commit. - **npm**: usually comes with Node.js, type `npm` in your terminal to check for its presence - [**ffmpeg**][ffmpeg]: a recent version (year 2019 or above), in `$PATH` or in the same directory as this README file (project root). - **git**: one or more npm dependencies require git. Install git with your favorite package manager or https://git-scm.com/downloads diff --git a/src/destreamer.ts b/src/destreamer.ts index f1a9e1c..560ad37 100644 --- a/src/destreamer.ts +++ b/src/destreamer.ts @@ -16,6 +16,7 @@ import puppeteer from 'puppeteer'; import colors from 'colors'; import path from 'path'; import fs from 'fs'; +import { URL } from 'url'; import sanitize from 'sanitize-filename'; import cliProgress from 'cli-progress'; @@ -233,7 +234,7 @@ async function downloadVideo(videoUrls: string[], outputDirectories: string[], s ffmpegCmd.spawn(); }); - process.off('SIGINT', cleanupFn); + process.removeListener('SIGINT', cleanupFn); } } diff --git a/tsconfig.json b/tsconfig.json index c8a30ce..d971e41 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "rootDirs": ["./src", "./test"], "outDir": "./build", - "target": "ES2019", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ + "target": "ES2017", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */ "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ "strict": true, /* Enable all strict type-checking options. */ "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */