Installation
Redact is designed to be easily installed and used in your project. Just follow these simple steps below.
Prerequisites
-
Ensure you have the latest version of Node installed. We also recommend you install Yarn as well.
Node >= 8.x and Yarn >= 1.5.
-
Create a project, if none exists, and change your directory to this project's root.
Installing Redact
This package is available through the npm registry. To install redact, on the command line, run:
NPM
$ npm -i @princedev/redact
Yarn
$ yarn add @princedev/redact
This will create the node_modules
directory in your current directory (if one doesn’t exist yet) and will download the package to that directory.
If there is no
package.json
file in the local directory, the latest version of the package is installed. If there is apackage.json
file, npm installs the latest version that satisfies the semver rule declared inpackage.json
.
Import
Start using the library by importing it:
CommonJS
const redact = require('@princedev/redact');
ES6
import { sum, difference } from '@princedev/redact';
By now, you should be able to use redact.