Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

better-sqlite3

Package Overview
Dependencies
Maintainers
1
Versions
131
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-sqlite3 - npm Package Compare versions

Comparing version 7.4.6 to 7.5.0

deps/sqlite3/sqlite3.c

11

deps/symlink.js

@@ -6,12 +6,15 @@ 'use strict';

const dest = process.argv[2];
const source = path.resolve(path.sep, process.argv[3]);
const source = path.resolve(path.sep, process.argv[3] || path.join(__dirname, 'sqlite3'));
const filenames = process.argv.slice(4).map(str => path.basename(str));
/*
This creates symlinks inside the <$2> directory, linking to the SQLite3
amalgamation files inside the directory specified by the absolute path <$3>.
This creates symlinks inside the <$2> directory, linking to files inside the
directory specified by the absolute path <$3>. If no path <$3> is provided,
the default path of "./deps/sqlite3" is used. The basenames of the files to
link are specified by <$4...>.
*/
for (const filename of ['sqlite3.c', 'sqlite3.h']) {
for (const filename of filenames) {
fs.accessSync(path.join(source, filename));
fs.symlinkSync(path.join(source, filename), path.join(dest, filename), 'file');
}

@@ -5,7 +5,5 @@ 'use strict';

const util = require('./util');
const SqliteError = require('./sqlite-error');
const {
Database: CPPDatabase,
setErrorConstructor,
} = require('bindings')('better_sqlite3.node');
let DEFAULT_ADDON;

@@ -39,2 +37,3 @@ function Database(filenameGiven, options) {

const verbose = 'verbose' in options ? options.verbose : null;
const nativeBindingPath = 'nativeBinding' in options ? options.nativeBinding : null;

@@ -46,3 +45,16 @@ // Validate interpreted options

if (verbose != null && typeof verbose !== 'function') throw new TypeError('Expected the "verbose" option to be a function');
if (nativeBindingPath != null && typeof nativeBindingPath !== 'string') throw new TypeError('Expected the "nativeBinding" option to be a string');
// Load the native addon
let addon;
if (nativeBindingPath == null) {
addon = DEFAULT_ADDON || (DEFAULT_ADDON = require('bindings')('better_sqlite3.node'));
} else {
addon = require(path.resolve(nativeBindingPath).replace(/(\.node)?$/, '.node'));
}
if (!addon.isInitialized) {
addon.setErrorConstructor(SqliteError);
addon.isInitialized = true;
}
// Make sure the specified directory exists

@@ -54,3 +66,3 @@ if (!anonymous && !fs.existsSync(path.dirname(filename))) {

Object.defineProperties(this, {
[util.cppdb]: { value: new CPPDatabase(filename, filenameGiven, anonymous, readonly, fileMustExist, timeout, verbose || null, buffer || null) },
[util.cppdb]: { value: new addon.Database(filename, filenameGiven, anonymous, readonly, fileMustExist, timeout, verbose || null, buffer || null) },
...wrappers.getters,

@@ -77,2 +89,1 @@ });

module.exports = Database;
setErrorConstructor(require('./sqlite-error'));

@@ -15,4 +15,3 @@ 'use strict';

Error.captureStackTrace(this, SqliteError);
descriptor.value = code;
Object.defineProperty(this, 'code', descriptor);
this.code = code;
}

@@ -19,0 +18,0 @@ Object.setPrototypeOf(SqliteError, Error);

{
"name": "better-sqlite3",
"version": "7.4.6",
"version": "7.5.0",
"description": "The fastest and simplest library for SQLite3 in Node.js.",
"homepage": "http://github.com/JoshuaWise/better-sqlite3",
"author": "Joshua Wise <joshuathomaswise@gmail.com>",
"main": "lib/index.js",
"repository": {

@@ -12,6 +11,12 @@ "type": "git",

},
"main": "lib/index.js",
"files": [
"binding.gyp",
"src/*.[ch]pp",
"lib/**",
"deps/**"
],
"dependencies": {
"bindings": "^1.5.0",
"prebuild-install": "^7.0.0",
"tar": "^6.1.11"
"prebuild-install": "^7.0.0"
},

@@ -18,0 +23,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc