diff --git a/.gitignore b/.gitignore index 0cf6da2..ccfb451 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules build +package-lock.json pnpm-lock.yaml \ No newline at end of file diff --git a/package.json b/package.json index a427ba8..7b001de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "passwordx", - "version": "1.1.2", + "version": "1.1.3", "description": "Use the cli to generate strong passwords or add them to nodejs projects", "main": "build/index.js", "types": "build/index.d.ts", @@ -31,6 +31,7 @@ "@typescript-eslint/eslint-plugin": "^4.28.2", "@typescript-eslint/parser": "^4.28.2", "eslint": "^7.30.0", + "ts-node": "^10.4.0", "typescript": "^4.3.5" } } diff --git a/src/cli.ts b/src/cli.ts index c9d1d23..b3c4dab 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,5 +1,5 @@ #! /usr/bin/env node -import passwordX from "./index"; +import * as passwordx from "./index.js"; import yargs from "yargs"; import { hideBin } from "yargs/helpers"; @@ -69,7 +69,7 @@ async function executeCli(): Promise { for (let index = 1; index <= args.count; index++) { console.info( `password ${index}:`, - passwordX({ + passwordx.generate({ ambiguousCharacters: args.ambiguous, digits: args.digit, length: args.length, @@ -83,7 +83,7 @@ async function executeCli(): Promise { } else { console.info( `password:`, - passwordX({ + passwordx.generate({ ambiguousCharacters: args.ambiguous, digits: args.digit, length: args.length, diff --git a/src/index.ts b/src/index.ts index 55069ed..b1ba2cd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -45,7 +45,7 @@ function formatPassword( return finalPassowrd; } -function PasswordX(options?: { +export function generate(options?: { /** * # Allow ambiguous characters * #### Default: ``false`` @@ -189,5 +189,3 @@ function PasswordX(options?: { return password; } - -export default PasswordX;