From 5c5d1d63ba0bf19910527866e50ee78aa80b1995 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 27 Sep 2022 14:30:54 +0700 Subject: [PATCH] Require Node.js 14 --- .github/workflows/main.yml | 7 ++++--- index.d.ts | 2 +- package.json | 9 +++++---- readme.md | 18 +++--------------- 4 files changed, 13 insertions(+), 23 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d36e1a8..d50ada6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,11 +10,12 @@ jobs: fail-fast: false matrix: node-version: + - 18 + - 16 - 14 - - 12 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - run: npm install diff --git a/index.d.ts b/index.d.ts index 10438fb..743cb90 100644 --- a/index.d.ts +++ b/index.d.ts @@ -8,7 +8,7 @@ Convert Windows backslash paths to slash paths: `foo\\bar` ➔ `foo/bar`. @example ``` -import path from 'path'; +import path from 'node:path'; import slash from 'slash'; const string = path.join('foo', 'bar'); diff --git a/package.json b/package.json index ef78101..54f05f8 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,9 @@ }, "type": "module", "exports": "./index.js", + "types": "./index.d.ts", "engines": { - "node": ">=12" + "node": ">=14.16" }, "scripts": { "test": "xo && ava && tsd" @@ -31,8 +32,8 @@ "convert" ], "devDependencies": { - "ava": "^3.15.0", - "tsd": "^0.14.0", - "xo": "^0.38.2" + "ava": "^4.3.3", + "tsd": "^0.24.1", + "xo": "^0.52.3" } } diff --git a/readme.md b/readme.md index 65d57db..42f74f9 100644 --- a/readme.md +++ b/readme.md @@ -8,14 +8,14 @@ This was created since the `path` methods in Node.js outputs `\\` paths on Windo ## Install -``` -$ npm install slash +```sh +npm install slash ``` ## Usage ```js -import path from 'path'; +import path from 'node:path'; import slash from 'slash'; const string = path.join('foo', 'bar'); @@ -34,15 +34,3 @@ slash(string); Type: `string` Accepts a Windows backslash path and returns a path with forward slashes. - ---- - -
- - Get professional support for this package with a Tidelift subscription - -
- - Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. -
-