node-mondrian
v1.0.4
Published
Brings k-anonymity and l-diversity to nodeJS by using [Mondrian](https://github.com/qiyuangong/Mondrian) and [Mondrian_L_Diversity](https://github.com/qiyuangong/Mondrian_L_Diversity) under the hood.
Downloads
4
Readme
Node-mondrian
Brings k-anonymity and l-diversity to nodeJS by using Mondrian and Mondrian_L_Diversity under the hood.
Developed as part of the Privacy Engineering course at the Technische Universität Berlin.
Usage
Install
npm install node-mondrian
Example
const Mondrian = require('node-mondrian')
// See this repo for example data
const data = require('data/adult.json')
const attributes = require('data/adult-attributes.json')
let anonymized = await Mondrian.kAnonymity(data, attributes, 10)
let diversified = await Mondrian.lDiversity(data, attributes, 10)
Results in:
[
{
"age": "28,53",
"workclass": "*",
"educationNum": "5,14",
"maritalStatus": "*",
"race": "*",
"sex": "*",
"nativeCountry": "*",
"occupation": "Adm-clerical"
},
{
"age": "28,53",
"workclass": "*",
"educationNum": "5,14",
"maritalStatus": "*",
Testing
npm test