From 7a178b5a9c300a69ffdba3b27068f0a7821df03c Mon Sep 17 00:00:00 2001 From: Tim Shamilov Date: Sat, 2 Dec 2023 04:30:55 -0500 Subject: [PATCH] feat: introduce npx --- package-lock.json | 3 +++ package.json | 3 +++ src/main.ts | 1 + 3 files changed, 7 insertions(+) diff --git a/package-lock.json b/package-lock.json index 7db3eff..bad9c7a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,9 @@ "uuid": "9.0.0", "ws": "8.12.0" }, + "bin": { + "dwn-server": "dist/esm/src/main.js" + }, "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.2.0", "@types/bytes": "3.1.1", diff --git a/package.json b/package.json index c41d8c6..462e847 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,9 @@ "require": "./dist/cjs/index.js" } }, + "bin": { + "dwn-server": "./dist/esm/src/main.js" + }, "repository": { "type": "git", "url": "https://github.com/TBD54566975/dwn-server.git" diff --git a/src/main.ts b/src/main.ts index df58215..ee0e51e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,3 +1,4 @@ +#!/usr/bin/env node // node.js 18 and earlier, needs globalThis.crypto polyfill. needed for dwn-sdk-js import { webcrypto } from 'node:crypto';