npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

secureshare-sdk

v1.0.0

Published

Enterprise privacy-preserving data sharing SDK with policy engine, audit logging, and compliance features

Readme

SecureShare SDK

Enterprise privacy-preserving data sharing SDK with policy engine, audit logging, and compliance features.

Features

  • Policy Engine: Define and enforce data access policies
  • Privacy Protection: Tokenization, masking, and encryption
  • Audit Logging: Comprehensive audit trails for compliance
  • Observer Effect: Real-time anomaly detection and adaptive responses
  • Multi-tenant Support: Isolated data and policies per tenant
  • Compliance Ready: GDPR, HIPAA, CCPA support

Installation

npm install secureshare-sdk

Quick Start

const { SecureShare, PolicyEvaluator, AuditLogger } = require('secureshare-sdk');

// Create SDK instance
const sdk = new SecureShare({ auditEnabled: true });

// Add a policy
await sdk.addPolicy({
  name: 'PII Protection',
  rules: [{
    condition: "data.type == 'PII'",
    action: 'tokenize',
    constraints: ['user.role == "analyst"']
  }]
});

// Process data
const result = await sdk.processData(
  { name: 'John Doe', email: '[email protected]', type: 'PII' },
  { user: { role: 'analyst' }, purpose: 'analysis' }
);

console.log(result);
// Output: { name: '***', email: '***', type: 'PII' }

API Reference

Core Classes

SecureShare

Main SDK class for data processing and policy management.

const sdk = new SecureShare({
  auditEnabled: true  // Enable audit logging
});

Methods:

  • addPolicy(policy): Add a new policy
  • processData(data, context): Process data according to policies
  • evaluateData(data, context): Evaluate data without processing
  • getAuditLogs(filters): Retrieve audit logs

PolicyEvaluator

Evaluate policies against data and context.

const evaluator = new PolicyEvaluator(policy);
const result = evaluator.evaluate(context);

AuditLogger

Log audit events for compliance.

AuditLogger.logAuditEvent({
  action: 'data_accessed',
  user: 'user123',
  timestamp: new Date(),
  details: { dataType: 'PII' }
});

Privacy Protection

Tokenization

const { Tokenizer } = require('secureshare-sdk');
const token = Tokenizer.tokenize('sensitive-data');
const original = Tokenizer.detokenize(token);

Masking

const { Masking } = require('secureshare-sdk');
const masked = Masking.maskValue('[email protected]');
// Output: '***@***.com'

Encryption

const { Encryption } = require('secureshare-sdk');
const encrypted = Encryption.encryptValue('sensitive-data');
const decrypted = Encryption.decryptValue(encrypted);

Policy Types

const policy = {
  name: 'Financial Data Policy',
  rules: [{
    condition: "data.type == 'financial'",
    action: 'encrypt',
    constraints: ['user.role == "manager"']
  }]
};

Actions:

  • allow: Allow access to data
  • deny: Deny access to data
  • tokenize: Replace with tokens
  • mask: Mask sensitive values
  • encrypt: Encrypt data
  • log: Log access without modification

Examples

Express.js Middleware

const express = require('express');
const { createSecureShareMiddleware } = require('secureshare-sdk');

const app = express();
const sdk = new SecureShare();

app.use('/api/data', createSecureShareMiddleware({
  secureShare: sdk,
  policyContext: (req) => ({
    user: req.user,
    purpose: req.query.purpose
  })
}));

Observer Effect Demo

const { ObserverEffectEngine } = require('secureshare-sdk');

const observer = new ObserverEffectEngine(db);
const result = await observer.evaluateObserverEffect({
  userId: 'user123',
  userRole: 'analyst',
  dataType: 'PII',
  accessPattern: 'bulk_export'
});

Configuration

Environment Variables

SECURESHARE_AUDIT_LOG=./audit.log
SECURESHARE_JWT_SECRET=your-secret-key
SECURESHARE_DB_URL=postgresql://user:pass@localhost/db

Database Support

  • PostgreSQL
  • Redis
  • MongoDB

Compliance

The SDK supports various compliance frameworks:

  • GDPR: Data protection and privacy
  • HIPAA: Healthcare data protection
  • CCPA: California consumer privacy
  • SOC 2: Security controls

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Support