UNPKG

redact-pii

Version:

Remove personally identifiable information from text.

14 lines (10 loc) 555 B
// process.env.GOOGLE_APPLICATION_CREDENTIALS = require('path').resolve( // __dirname + '/../node-mordor/credentials/node-mordor-prod-key.json' // // __dirname + '/../node-mordor/credentials/node-mordor-dev-key.json' // ); const fs = require('fs'); const { SyncRedactor, AsyncRedactor, GoogleDLPRedactor } = require('./lib/index.js'); // const bigText = fs.readFileSync('./big.txt', 'utf8'); const redactor = new SyncRedactor(); console.log(redactor.redact('My phone is a Samsung brand device.')); console.log(redactor.redact('My name is Jared'));