Skip to content

Commit

Permalink
chore(docs): update readme and templates
Browse files Browse the repository at this point in the history
  • Loading branch information
SMAKSS committed Nov 3, 2023
1 parent dece6e4 commit 6ed41d6
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 46 deletions.
8 changes: 0 additions & 8 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ For bug reports, please fill out the information below to help us understand the
-->

# Brief Description

<!-- A brief description of the issue.-->

## Environment
Expand All @@ -16,35 +15,28 @@ For bug reports, please fill out the information below to help us understand the
- `npm` (or `yarn`) version:

## Code Snippet

<!-- Please provide any relevant code snippets or examples here -->

```javascript
// Your code here
```

## Steps to Reproduce

<!-- What steps did we need to take to encounter the problem? -->

## Expected Behavior

<!-- What you expected to happen -->

## Actual Behavior

<!-- What actually happened. Include the full error message/screenshots/anything that might help understanding the issue -->

## Reproduction Repository

<!--
If possible, please provide a repository link where the issue can be reproduced. A minimal test case would be greatly appreciated and can significantly speed up the resolution process.
-->

## Problem Description

<!-- A clear and concise description of what the problem is. Include any additional context that might help us understand the issue. -->

## Suggested Solution

<!-- If you have any suggestion on how to fix the issue please provide it here. If not, just leave this section blank. -->
1 change: 0 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Resolves #0000 <!-- link to issue or task card if one exists -->
-->

## WHAT does this PR introduce or fix?

<!--
Detailed summary of changes. Indicate if it introduces a new feature, fixes a bug, or makes improvements.
Before/after code snippets or explanations are recommended for critical changes.
Expand Down
72 changes: 35 additions & 37 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,89 +2,87 @@

![npm](https://img.shields.io/npm/v/@smakss/password-generator) ![NPM](https://img.shields.io/npm/l/@smakss/password-generator) ![npm](https://img.shields.io/npm/dt/@smakss/password-generator) ![npm bundle size (scoped)](https://img.shields.io/bundlephobia/min/@smakss/password-generator)

Secure passwords for users might be a big challenge for us. This package will help you to generate secure random password easily. You can choose allowed characters and even defined them by yourself with random or given length. Also, this package uses ES6+ syntax so if you using older standards for writing JS code you may need a transpiler for it.
Creating secure passwords for users might be a big challenge for developers. This package will help you generate secure random passwords easily. You can choose from a predefined set of character types or define your own characters with a specified or random length. This package is written using ES6+ syntax, so if you're using older standards of JavaScript, a transpiler like Babel may be required.

## Demo

You can check the [working demo](https://runkit.com/smakss/password-generator) in runkit.
Check out the [working demo](https://runkit.com/smakss/password-generator) on RunKit.

or

[![View @smakss/password-generator](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/smakss-password-generator-o9ev4k?fontsize=14&hidenavigation=1&theme=dark)

## How it works?
## How It Works

To install it you can simply do the following command:
To install the package, run:

```bash
npm i @smakss/password-generator
or
# or
yarn add @smakss/password-generator
```

to include it with common js module you should do this:
To include it using CommonJS syntax:

```js
var PasswordGenerator = require('@smakss/password-generator');
const PasswordGenerator = require('@smakss/password-generator');
```

and to include it with ECMAscript module you can simply do this one:
For ECMAScript modules:

```js
import PasswordGenerator from '@smakss/password-generator';
```

then to use it within your application you can do it just like below:
To use it within your application:

The search function will accept 6 optional input parameter:
The `PasswordGenerator` function accepts an options object with the following optional parameters:

- `length` (`Number`, , Default: `1-20`): The length of the desired password. If you left it blank it will be a random number between 1 to 20.
- `lowerIncluded` (`Boolean`, Default: `True`): You can include or exclude lowercase characters, by default, it's `True` which means the lowercase characters are included.
- `capsIncluded` (`Boolean`, Default: `True`): You can include or exclude capital characters, by default, it's `True` which means the capital characters are included.
- `numIncluded` (`Boolean`, Default: `True`): You can include or exclude numbers, by default, it's `True` which means the numbers are included.
- `specIncluded` (`Boolean`, Default: `True`): You can include or exclude special characters, by default, it's `True` which means the special characters are included.
- `characters` (`Array`): You can assign your desired characters to the function with an array of them, e. g. `["a", 1, "~"]`.
- `length` (`number`, Default: random between 1-20): The length of the desired password.
- `lowerIncluded` (`boolean`, Default: `true`): Include lowercase characters.
- `capsIncluded` (`boolean`, Default: `true`): Include uppercase characters.
- `numIncluded` (`boolean`, Default: `true`): Include numeric characters.
- `specIncluded` (`boolean`, Default: `true`): Include special characters.
- `characters` (`Array<string | number>`): Specify custom characters for the password.

## Examples of usage
## Examples of Usage

### Invoking function with default parameters
### Generate a password with default parameters

```js
PasswordGenerator({});

// Result: "s%gu?TcT]bvc9"
const password = PasswordGenerator();
// Result might be something like: "s%gu?TcT]bvc9"
```

### Invoking function with optional parameters

Generate a password with length of 10 including all sets of characters:
### Generate a password with a specified length

```js
PasswordGenerator({ length: 10 });

// Result: ",tWy%[T8fU"
const password = PasswordGenerator({ length: 10 });
// Result might be something like: ",tWy%[T8fU"
```

Exclude numbers and lowercase characters:
### Generate a password excluding numbers and lowercase characters

```js
PasswordGenerator({ length: 10, lowerIncluded: false, numIncluded: false });

// Result: ":+U,G:JNXL"
const password = PasswordGenerator({
length: 10,
lowerIncluded: false,
numIncluded: false
});
// Result might be something like: ":+U,G:JNXL"
```

Just use `"a"`, `1`, and `"~"` characters to generate a new password:
### Generate a password using only specified characters

```js
PasswordGenerator({ length: 10, characters: ['a', 1, '~'] });

// Result: "~a~a1~~~a~"
const password = PasswordGenerator({ length: 10, characters: ['a', 1, '~'] });
// Result might be something like: "~a~a1~~~a~"
```

## Contributing

Interested in making contributions to this project? Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines and details.
If you're interested in contributing to this project, please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines and details.

## Code of Conduct

We value and prioritize the well-being of all our contributors and users. To ensure that this project remains a welcoming space for everyone, please refer to our [Code of Conduct](./CODE_OF_CONDUCT.md).
We value the well-being of all contributors and users. To ensure this project remains welcoming to everyone, please refer to our [Code of Conduct](./CODE_OF_CONDUCT.md).

0 comments on commit 6ed41d6

Please sign in to comment.