-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
103 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.idea | ||
node_modules | ||
coverage | ||
coverage | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.idea | ||
node_modules | ||
coverage | ||
package-lock.json | ||
test | ||
.eslintrc.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015 Jehy | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,37 @@ | ||
#Mak sensitive | ||
|
||
# Mask sensitive | ||
[![npm](https://img.shields.io/npm/v/mask-sensitive.svg)](https://npm.im/mask-sensitive) | ||
[![license](https://img.shields.io/npm/l/mask-sensitive.svg)](https://npm.im/mask-sensitive) | ||
[![Build Status](https://travis-ci.org/jehy/mask-sensitive.svg?branch=master)](https://travis-ci.org/jehy/mask-sensitive) | ||
[![Coverage Status](https://coveralls.io/repos/github/jehy/mask-sensitive/badge.svg?branch=master)](https://coveralls.io/github/jehy/mask-sensitive?branch=master) | ||
[![dependencies Status](https://david-dm.org/jehy/mask-sensitive/status.svg)](https://david-dm.org/jehy/mask-sensitive) | ||
[![devDependencies Status](https://david-dm.org/jehy/mask-sensitive/dev-status.svg)](https://david-dm.org/jehy/mask-sensitive?type=dev) | ||
|
||
Masks sensitive data with several different methods. | ||
|
||
##Installation | ||
## Installation | ||
|
||
```bash | ||
npm install mask-sensitive | ||
``` | ||
|
||
##Usage | ||
## Usage | ||
|
||
```js | ||
var | ||
mask = require('mask-sensitive'), | ||
password = 'very sensitive data', | ||
masked = mask(password, {mode: 'secure'}); | ||
var mask = require('mask-sensitive'); | ||
var password = 'very sensitive data'; | ||
var masked = mask(password, {mode: 'secure'}); | ||
``` | ||
|
||
## Modes | ||
|
||
* `secure` - return "***"; | ||
* `length` - return equal to length number of "*"; | ||
* `secure` - return `***`; | ||
* `length` - return equal to length number of `*`; | ||
* `half` - mask first and last 1/4; | ||
* `every` - mask every third char; | ||
* `middle` - replace middle with "***"; | ||
* `middle` - replace middle with `***`; | ||
|
||
By default, `secure` method is used. | ||
|
||
##Important | ||
## Important | ||
* All data less then 4 chars will be masked with `secure` mode; | ||
* null is masked as ***. | ||
* null is masked as ***. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters