JSPM

cross-sqlcipher

0.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q28723F

Cross-platform encrypted sqlite3

Package Exports

  • cross-sqlcipher

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cross-sqlcipher) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cross-sqlcipher

Cross-platform encrypted sqlite3 See also: win-sqlcipher, unix-sqlcipher

npm install cross-sqlcipher

# for NW.js (formally node-webkit)
npm i cross-sqlcipher --runtime=node-webkit --target=0.12.3 --target_arch=x64
var sqlite3 = require('cross-sqlcipher').verbose();
var db = new sqlite3.Database('test.db');

db.serialize(function() {
  db.run("PRAGMA KEY = 'secret'");
  db.run("PRAGMA CIPHER = 'aes-128-cbc'");

  db.run("DROP TABLE IF EXISTS lorem");
  db.run("CREATE TABLE lorem (info TEXT)");

  var stmt = db.prepare("INSERT INTO lorem VALUES (?)");
  for (var i = 0; i < 10; i++) {
    stmt.run("Ipsum " + i);
  }
  stmt.finalize();

  db.each("SELECT rowid AS id, info FROM lorem", function(err, row) {
    console.log(row.id + ": " + row.info);
  });
});

db.close();