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.
npm install node-mondrian
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": "*",
npm test