From b7347e76a8a28fcb7c3e6197dac586934c4cf401 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 3 Jul 2023 12:09:06 +0200 Subject: [PATCH] Require Node.js 16 Fixes #3 --- .github/workflows/main.yml | 11 +++++------ cli.js | 15 ++++++++------- license | 2 +- package.json | 17 +++++++++-------- readme.md | 6 ++---- test.js | 2 +- 6 files changed, 26 insertions(+), 27 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 18531b3..1ed55d5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,13 +10,12 @@ jobs: fail-fast: false matrix: node-version: - - 14 - - 12 - - 10 - - 8 + - 20 + - 18 + - 16 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - run: npm install diff --git a/cli.js b/cli.js index abf25c7..1c84dc1 100755 --- a/cli.js +++ b/cli.js @@ -1,7 +1,7 @@ #!/usr/bin/env node -'use strict'; -const meow = require('meow'); -const hasha = require('hasha'); +import process from 'node:process'; +import meow from 'meow'; +import hasha from 'hasha'; const cli = meow(` Usage @@ -16,16 +16,17 @@ const cli = meow(` $ hasha unicorn --algorithm=md5 1abcb33beeb811dca15f0ac3e47b88d9 `, { + importMeta: import.meta, flags: { algorithm: { type: 'string', - alias: 'a' + shortFlag: 'a', }, encoding: { type: 'string', - alias: 'e' - } - } + shortFlag: 'e', + }, + }, }); const input = cli.input[0]; 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 24efe95..0505610 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,14 @@ "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" + "url": "https://sindresorhus.com" }, + "type": "module", "bin": { - "hasha": "cli.js" + "hasha": "./cli.js" }, "engines": { - "node": ">=8" + "node": ">=16" }, "scripts": { "test": "xo && ava" @@ -46,12 +47,12 @@ "easy" ], "dependencies": { - "hasha": "^5.0.0", - "meow": "^5.0.0" + "hasha": "^5.2.2", + "meow": "^12.0.1" }, "devDependencies": { - "ava": "^2.1.0", - "execa": "^2.0.3", - "xo": "^0.24.0" + "ava": "^5.3.1", + "execa": "^7.1.1", + "xo": "^0.54.2" } } diff --git a/readme.md b/readme.md index 89b05f8..94402c7 100644 --- a/readme.md +++ b/readme.md @@ -2,13 +2,11 @@ > Hashing made simple. Get the hash of text or stdin. - ## Install +```sh +npm install --global hasha-cli ``` -$ npm install --global hasha-cli -``` - ## Usage diff --git a/test.js b/test.js index 6eec537..bed189d 100644 --- a/test.js +++ b/test.js @@ -1,5 +1,5 @@ import test from 'ava'; -import execa from 'execa'; +import {execa} from 'execa'; import hasha from 'hasha'; const input = 'unicorn';