diff --git a/node-vlmcs/LICENSE b/node-vlmcs/LICENSE new file mode 100644 index 00000000..ce066b8c --- /dev/null +++ b/node-vlmcs/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022-Present ikxin + +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: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node-vlmcs/README.md b/node-vlmcs/README.md new file mode 100644 index 00000000..5e0b3690 --- /dev/null +++ b/node-vlmcs/README.md @@ -0,0 +1,62 @@ +# node-vlmcs + +Node.js implementation of the `vlmcs` KMS client, with both a CLI and a programmatic API. + +## Install + +```bash +npm install node-vlmcs +``` + +Install globally if you want the `vlmcs` command: + +```bash +npm install -g node-vlmcs +``` + +## CLI + +Show help: + +```bash +vlmcs -h +``` + +Examples: + +```bash +vlmcs 192.168.1.5 +vlmcs -l "Office 2013 Professional" -4 192.168.1.5 +vlmcs -x +``` + +## API + +```ts +import { runVlmcs } from 'node-vlmcs' + +const result = await runVlmcs({ + host: '127.0.0.1', + port: 1688, + protocol: 6, + timeout: 5000, + verbose: false +}) + +console.log(result) +``` + +## Publish + +From the package directory: + +```bash +npm login +npm publish +``` + +The package runs `npm run build` automatically before publish via `prepublishOnly`. + +## License + +MIT diff --git a/node-vlmcs/package.json b/node-vlmcs/package.json index 655ef829..b85f9450 100644 --- a/node-vlmcs/package.json +++ b/node-vlmcs/package.json @@ -15,8 +15,12 @@ "bin": { "vlmcs": "dist/cli.js" }, + "files": [ + "dist" + ], "scripts": { "build": "tsc", + "prepublishOnly": "npm run build", "start": "node dist/cli.js" }, "license": "MIT", diff --git a/node-vlmcs/tsconfig.json b/node-vlmcs/tsconfig.json index 68c9371b..fa27c639 100644 --- a/node-vlmcs/tsconfig.json +++ b/node-vlmcs/tsconfig.json @@ -3,6 +3,7 @@ "target": "ES2022", "module": "commonjs", "lib": ["ES2022"], + "types": ["node"], "outDir": "./dist", "rootDir": "./src", "strict": false,