Socket
Socket
Sign inDemoInstall

mongodb-prebuilt

Package Overview
Dependencies
134
Maintainers
3
Versions
67
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.4.0 to 6.5.0

built/bin/runCommandHelper.d.ts

10

built/bin/bsondump.js
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mongo_bins_1 = require("../mongo-bins");
var COMMAND = "bsondump";
var mongoBin = new mongo_bins_1.MongoBins(COMMAND, process.argv.slice(2), { stdio: 'inherit' });
mongoBin.run().then(function () {
//console.log(`${COMMAND} is now running`);
}, function (e) {
console.error("unable to launch " + COMMAND, e);
});
var runCommandHelper_1 = require("./runCommandHelper");
runCommandHelper_1.runCommand('bsondump');
//# sourceMappingURL=/Users/alwyn/crashburn/mongodb-prebuilt/bin/bsondump.js.map

11

built/bin/mongo.js
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mongo_bins_1 = require("../mongo-bins");
var COMMAND = "mongo";
var mongoBin = new mongo_bins_1.MongoBins(COMMAND, process.argv.slice(2), { stdio: 'inherit' });
mongoBin.run().then(function () {
//console.log(`${COMMAND} is now running`);
console.log('command is running');
}, function (e) {
console.error("unable to launch " + COMMAND, e);
});
var runCommandHelper_1 = require("./runCommandHelper");
runCommandHelper_1.runCommand('mongo');
//# sourceMappingURL=/Users/alwyn/crashburn/mongodb-prebuilt/bin/mongo.js.map
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mongo_bins_1 = require("../mongo-bins");
var COMMAND = "mongod";
var mongoBin = new mongo_bins_1.MongoBins(COMMAND, process.argv.slice(2), { stdio: 'inherit' });
mongoBin.run().then(function () {
//console.log(`${COMMAND} is now running`);
}, function (e) {
console.error("unable to launch " + COMMAND, e);
});
var runCommandHelper_1 = require("./runCommandHelper");
runCommandHelper_1.runCommand('mongod');
//# sourceMappingURL=/Users/alwyn/crashburn/mongodb-prebuilt/bin/mongod.js.map
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mongo_bins_1 = require("../mongo-bins");
var COMMAND = "mongodump";
var mongoBin = new mongo_bins_1.MongoBins(COMMAND, process.argv.slice(2), { stdio: 'inherit' });
mongoBin.run().then(function () {
//console.log(`${COMMAND} is now running`);
}, function (e) {
console.error("unable to launch " + COMMAND, e);
});
var runCommandHelper_1 = require("./runCommandHelper");
runCommandHelper_1.runCommand('mongodump');
//# sourceMappingURL=/Users/alwyn/crashburn/mongodb-prebuilt/bin/mongodump.js.map
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mongo_bins_1 = require("../mongo-bins");
var COMMAND = "mongoexport";
var mongoBin = new mongo_bins_1.MongoBins(COMMAND, process.argv.slice(2), { stdio: 'inherit' });
mongoBin.run().then(function () {
//console.log(`${COMMAND} is now running`);
}, function (e) {
console.error("unable to launch " + COMMAND, e);
});
var runCommandHelper_1 = require("./runCommandHelper");
runCommandHelper_1.runCommand('mongoexport');
//# sourceMappingURL=/Users/alwyn/crashburn/mongodb-prebuilt/bin/mongoexport.js.map
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mongo_bins_1 = require("../mongo-bins");
var COMMAND = "mongofiles";
var mongoBin = new mongo_bins_1.MongoBins(COMMAND, process.argv.slice(2), { stdio: 'inherit' });
mongoBin.run().then(function () {
//console.log(`${COMMAND} is now running`);
}, function (e) {
console.error("unable to launch " + COMMAND, e);
});
var runCommandHelper_1 = require("./runCommandHelper");
runCommandHelper_1.runCommand('mongofiles');
//# sourceMappingURL=/Users/alwyn/crashburn/mongodb-prebuilt/bin/mongofiles.js.map
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mongo_bins_1 = require("../mongo-bins");
var COMMAND = "mongoimport";
var mongoBin = new mongo_bins_1.MongoBins(COMMAND, process.argv.slice(2), { stdio: 'inherit' });
mongoBin.run().then(function () {
//console.log(`${COMMAND} is now running`);
}, function (e) {
console.error("unable to launch " + COMMAND, e);
});
var runCommandHelper_1 = require("./runCommandHelper");
runCommandHelper_1.runCommand('mongoimport');
//# sourceMappingURL=/Users/alwyn/crashburn/mongodb-prebuilt/bin/mongoimport.js.map
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mongo_bins_1 = require("../mongo-bins");
var COMMAND = "mongooplog";
var mongoBin = new mongo_bins_1.MongoBins(COMMAND, process.argv.slice(2), { stdio: 'inherit' });
mongoBin.run().then(function () {
//console.log(`${COMMAND} is now running`);
}, function (e) {
console.error("unable to launch " + COMMAND, e);
});
var runCommandHelper_1 = require("./runCommandHelper");
runCommandHelper_1.runCommand('mongooplog');
//# sourceMappingURL=/Users/alwyn/crashburn/mongodb-prebuilt/bin/mongooplog.js.map
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mongo_bins_1 = require("../mongo-bins");
var COMMAND = "mongoperf";
var mongoBin = new mongo_bins_1.MongoBins(COMMAND, process.argv.slice(2), { stdio: 'inherit' });
mongoBin.run().then(function () {
//console.log(`${COMMAND} is now running`);
}, function (e) {
console.error("unable to launch " + COMMAND, e);
});
var runCommandHelper_1 = require("./runCommandHelper");
runCommandHelper_1.runCommand('mongoperf');
//# sourceMappingURL=/Users/alwyn/crashburn/mongodb-prebuilt/bin/mongoperf.js.map
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mongo_bins_1 = require("../mongo-bins");
var COMMAND = "mongorestore";
var mongoBin = new mongo_bins_1.MongoBins(COMMAND, process.argv.slice(2), { stdio: 'inherit' });
mongoBin.run().then(function () {
//console.log(`${COMMAND} is now running`);
}, function (e) {
console.error("unable to launch " + COMMAND, e);
});
var runCommandHelper_1 = require("./runCommandHelper");
runCommandHelper_1.runCommand('mongorestore');
//# sourceMappingURL=/Users/alwyn/crashburn/mongodb-prebuilt/bin/mongorestore.js.map
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mongo_bins_1 = require("../mongo-bins");
var COMMAND = "mongos";
var mongoBin = new mongo_bins_1.MongoBins(COMMAND, process.argv.slice(2), { stdio: 'inherit' });
mongoBin.run().then(function () {
//console.log(`${COMMAND} is now running`);
}, function (e) {
console.error("unable to launch " + COMMAND, e);
});
var runCommandHelper_1 = require("./runCommandHelper");
runCommandHelper_1.runCommand('mongos');
//# sourceMappingURL=/Users/alwyn/crashburn/mongodb-prebuilt/bin/mongos.js.map
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mongo_bins_1 = require("../mongo-bins");
var COMMAND = "mongosniff";
var mongoBin = new mongo_bins_1.MongoBins(COMMAND, process.argv.slice(2), { stdio: 'inherit' });
mongoBin.run().then(function () {
//console.log(`${COMMAND} is now running`);
}, function (e) {
console.error("unable to launch " + COMMAND, e);
});
var runCommandHelper_1 = require("./runCommandHelper");
runCommandHelper_1.runCommand('mongosniff');
//# sourceMappingURL=/Users/alwyn/crashburn/mongodb-prebuilt/bin/mongosniff.js.map
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mongo_bins_1 = require("../mongo-bins");
var COMMAND = "mongostat";
var mongoBin = new mongo_bins_1.MongoBins(COMMAND, process.argv.slice(2), { stdio: 'inherit' });
mongoBin.run().then(function () {
//console.log(`${COMMAND} is now running`);
}, function (e) {
console.error("unable to launch " + COMMAND, e);
});
var runCommandHelper_1 = require("./runCommandHelper");
runCommandHelper_1.runCommand('mongostat');
//# sourceMappingURL=/Users/alwyn/crashburn/mongodb-prebuilt/bin/mongostat.js.map
#!/usr/bin/env node
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var mongo_bins_1 = require("../mongo-bins");
var COMMAND = "mongotop";
var mongoBin = new mongo_bins_1.MongoBins(COMMAND, process.argv.slice(2), { stdio: 'inherit' });
mongoBin.run().then(function () {
//console.log(`${COMMAND} is now running`);
}, function (e) {
console.error("unable to launch " + COMMAND, e);
});
var runCommandHelper_1 = require("./runCommandHelper");
runCommandHelper_1.runCommand('mongotop');
//# sourceMappingURL=/Users/alwyn/crashburn/mongodb-prebuilt/bin/mongotop.js.map
/// <reference types="node" />
import { SpawnOptions, ChildProcess } from 'child_process';
import { IMongoDBDownloadOpts } from './mongod-helper';
import { IMongoDBDownloadOptions } from 'mongodb-download';
import { MongoDBPrebuilt } from './mongodb-prebuilt';
import { MongoSupervise } from './mongodb-supervise';
export declare class MongoBins {
command: string;
commandArguments: string[];
spawnOptions: SpawnOptions;
command: string;
execPath: string;
debug: any;

@@ -15,3 +14,3 @@ childProcess: ChildProcess;

mongoDBPrebuilt: MongoDBPrebuilt;
constructor(command: string, commandArguments?: string[], spawnOptions?: SpawnOptions, downloadOptions?: IMongoDBDownloadOpts);
constructor(command: string, commandArguments?: string[], spawnOptions?: SpawnOptions, downloadOptions?: Partial<IMongoDBDownloadOptions>);
run(): Promise<boolean>;

@@ -18,0 +17,0 @@ runCommand(): Promise<boolean>;

@@ -12,6 +12,6 @@ "use strict";

if (spawnOptions === void 0) { spawnOptions = {}; }
this.command = command;
this.commandArguments = commandArguments;
this.spawnOptions = spawnOptions;
this.debug = Debug("mongodb-prebuilt-MongoBins");
this.command = command;
if (downloadOptions) {

@@ -18,0 +18,0 @@ this.mongoDBPrebuilt = new mongodb_prebuilt_1.MongoDBPrebuilt(downloadOptions);

/// <reference types="node" />
import { MongoBins } from './mongo-bins';
export interface IMongoDBDownloadOpts {
platform?: string;
arch?: string;
version?: string;
downloadDir?: string;
http?: any;
}
import { IMongoDBDownloadOptions } from 'mongodb-download';
export declare class MongodHelper {

@@ -15,3 +9,3 @@ mongoBin: MongoBins;

private rejectLink;
constructor(commandArguments?: string[], downloadOptions?: IMongoDBDownloadOpts);
constructor(commandArguments?: string[], downloadOptions?: Partial<IMongoDBDownloadOptions>);
run(): Promise<boolean>;

@@ -18,0 +12,0 @@ stop(): void;

@@ -1,8 +0,7 @@

import { MongoDBDownload } from 'mongodb-download';
import { IMongoDBDownloadOpts } from './mongod-helper';
import { IMongoDBDownloadOptions, MongoDBDownload } from 'mongodb-download';
export declare class MongoDBPrebuilt {
mongoDBDownload?: MongoDBDownload | IMongoDBDownloadOpts;
mongoDBDownload?: MongoDBDownload | Partial<IMongoDBDownloadOptions>;
private debug;
private binPath;
constructor(mongoDBDownload?: MongoDBDownload | IMongoDBDownloadOpts);
constructor(mongoDBDownload?: MongoDBDownload | Partial<IMongoDBDownloadOptions>);
getHomeDirectory(): string;

@@ -9,0 +8,0 @@ getBinPath(): Promise<string>;

{
"name": "mongodb-prebuilt",
"version": "6.4.0",
"version": "6.5.0",
"description": "Install MongoDB prebuilt binaries via npm",

@@ -5,0 +5,0 @@ "main": "built/mongodb-prebuilt-all",

@@ -57,2 +57,16 @@ # mongodb-prebuilt

## CLI usage
The latest version of MongoDB is used by default for your OS and `~/.mongodb-prebuilt` for downloading MongoDB binary.
You can set desired version, download folder, architecture and platform through environment variables:
```
MONGODB_VERSION
MONGODB_DOWNLOADDIR
MONGODB_ARCH
MONGODB_PLATFORM
```
For example:
```
export MONGODB_DOWNLOADDIR='./' MONGODB_VERSION=3.4.10
mongod --port 27018 --dbpath ./mongodb --logpath /dev/stdout
```
## Programmatic usage

@@ -59,0 +73,0 @@

#!/usr/bin/env node
import { runCommand } from './runCommandHelper';
import {MongoBins} from '../mongo-bins';
const COMMAND: string = "bsondump";
let mongoBin: MongoBins = new MongoBins(COMMAND, process.argv.slice(2), {stdio: 'inherit'});
mongoBin.run().then(() => {
//console.log(`${COMMAND} is now running`);
}, (e) => {
console.error(`unable to launch ${COMMAND}`, e);
});
runCommand('bsondump');
#!/usr/bin/env node
import { runCommand } from './runCommandHelper';
import {MongoBins} from '../mongo-bins';
const COMMAND: string = "mongo";
let mongoBin: MongoBins = new MongoBins(COMMAND, process.argv.slice(2), {stdio: 'inherit'});
mongoBin.run().then(() => {
//console.log(`${COMMAND} is now running`);
console.log('command is running');
}, (e) => {
console.error(`unable to launch ${COMMAND}`, e);
});
runCommand('mongo');
#!/usr/bin/env node
import { runCommand } from './runCommandHelper';
import {MongoBins} from '../mongo-bins';
const COMMAND: string = "mongod";
let mongoBin: MongoBins = new MongoBins(COMMAND, process.argv.slice(2), {stdio: 'inherit'});
mongoBin.run().then(() => {
//console.log(`${COMMAND} is now running`);
}, (e) => {
console.error(`unable to launch ${COMMAND}`, e);
});
runCommand('mongod');
#!/usr/bin/env node
import { runCommand } from './runCommandHelper';
import {MongoBins} from '../mongo-bins';
const COMMAND: string = "mongodump";
let mongoBin: MongoBins = new MongoBins(COMMAND, process.argv.slice(2), {stdio: 'inherit'});
mongoBin.run().then(() => {
//console.log(`${COMMAND} is now running`);
}, (e) => {
console.error(`unable to launch ${COMMAND}`, e);
});
runCommand('mongodump');
#!/usr/bin/env node
import { runCommand } from './runCommandHelper';
import {MongoBins} from '../mongo-bins';
const COMMAND: string = "mongoexport";
let mongoBin: MongoBins = new MongoBins(COMMAND, process.argv.slice(2), {stdio: 'inherit'});
mongoBin.run().then(() => {
//console.log(`${COMMAND} is now running`);
}, (e) => {
console.error(`unable to launch ${COMMAND}`, e);
});
runCommand('mongoexport');
#!/usr/bin/env node
import {MongoBins} from '../mongo-bins';
const COMMAND: string = "mongofiles";
import { runCommand } from './runCommandHelper';
let mongoBin: MongoBins = new MongoBins(COMMAND, process.argv.slice(2), {stdio: 'inherit'});
mongoBin.run().then(() => {
//console.log(`${COMMAND} is now running`);
}, (e) => {
console.error(`unable to launch ${COMMAND}`, e);
});
runCommand('mongofiles');
#!/usr/bin/env node
import {MongoBins} from '../mongo-bins';
const COMMAND: string = "mongoimport";
import { runCommand } from './runCommandHelper';
let mongoBin: MongoBins = new MongoBins(COMMAND, process.argv.slice(2), {stdio: 'inherit'});
mongoBin.run().then(() => {
//console.log(`${COMMAND} is now running`);
}, (e) => {
console.error(`unable to launch ${COMMAND}`, e);
});
runCommand('mongoimport');
#!/usr/bin/env node
import {MongoBins} from '../mongo-bins';
const COMMAND: string = "mongooplog";
import { runCommand } from './runCommandHelper';
let mongoBin: MongoBins = new MongoBins(COMMAND, process.argv.slice(2), {stdio: 'inherit'});
mongoBin.run().then(() => {
//console.log(`${COMMAND} is now running`);
}, (e) => {
console.error(`unable to launch ${COMMAND}`, e);
});
runCommand('mongooplog');
#!/usr/bin/env node
import {MongoBins} from '../mongo-bins';
const COMMAND: string = "mongoperf";
import { runCommand } from './runCommandHelper';
let mongoBin: MongoBins = new MongoBins(COMMAND, process.argv.slice(2), {stdio: 'inherit'});
mongoBin.run().then(() => {
//console.log(`${COMMAND} is now running`);
}, (e) => {
console.error(`unable to launch ${COMMAND}`, e);
});
runCommand('mongoperf');
#!/usr/bin/env node
import {MongoBins} from '../mongo-bins';
const COMMAND: string = "mongorestore";
import { runCommand } from './runCommandHelper';
let mongoBin: MongoBins = new MongoBins(COMMAND, process.argv.slice(2), {stdio: 'inherit'});
mongoBin.run().then(() => {
//console.log(`${COMMAND} is now running`);
}, (e) => {
console.error(`unable to launch ${COMMAND}`, e);
});
runCommand('mongorestore');
#!/usr/bin/env node
import {MongoBins} from '../mongo-bins';
const COMMAND: string = "mongos";
import { runCommand } from './runCommandHelper';
let mongoBin: MongoBins = new MongoBins(COMMAND, process.argv.slice(2), {stdio: 'inherit'});
mongoBin.run().then(() => {
//console.log(`${COMMAND} is now running`);
}, (e) => {
console.error(`unable to launch ${COMMAND}`, e);
});
runCommand('mongos');
#!/usr/bin/env node
import {MongoBins} from '../mongo-bins';
const COMMAND: string = "mongosniff";
import { runCommand } from './runCommandHelper';
let mongoBin: MongoBins = new MongoBins(COMMAND, process.argv.slice(2), {stdio: 'inherit'});
mongoBin.run().then(() => {
//console.log(`${COMMAND} is now running`);
}, (e) => {
console.error(`unable to launch ${COMMAND}`, e);
});
runCommand('mongosniff');
#!/usr/bin/env node
import {MongoBins} from '../mongo-bins';
const COMMAND: string = "mongostat";
import { runCommand } from './runCommandHelper';
let mongoBin: MongoBins = new MongoBins(COMMAND, process.argv.slice(2), {stdio: 'inherit'});
mongoBin.run().then(() => {
//console.log(`${COMMAND} is now running`);
}, (e) => {
console.error(`unable to launch ${COMMAND}`, e);
});
runCommand('mongostat');
#!/usr/bin/env node
import {MongoBins} from '../mongo-bins';
const COMMAND: string = "mongotop";
import { runCommand } from './runCommandHelper';
let mongoBin: MongoBins = new MongoBins(COMMAND, process.argv.slice(2), {stdio: 'inherit'});
mongoBin.run().then(() => {
//console.log(`${COMMAND} is now running`);
}, (e) => {
console.error(`unable to launch ${COMMAND}`, e);
});
runCommand('mongotop');
const Debug: any = require('debug');
import { resolve as resolvePath } from 'path';
import { SpawnOptions, ChildProcess, spawn as spawnChild } from 'child_process';
import { IMongoDBDownloadOpts } from './mongod-helper';
import { IMongoDBDownloadOptions } from 'mongodb-download';
import { MongoDBPrebuilt } from './mongodb-prebuilt';
import { MongoSupervise } from './mongodb-supervise';
import { MongoDBDownload } from 'mongodb-download';
export class MongoBins {
command: string;
execPath: string;
debug: any;

@@ -18,11 +15,10 @@ childProcess: ChildProcess;

constructor(
command: string,
public command: string,
public commandArguments: string[] = [],
public spawnOptions: SpawnOptions = {},
downloadOptions?: IMongoDBDownloadOpts
downloadOptions?: Partial<IMongoDBDownloadOptions>
) {
this.debug = Debug(`mongodb-prebuilt-MongoBins`);
this.command = command;
if (downloadOptions) {

@@ -33,3 +29,2 @@ this.mongoDBPrebuilt = new MongoDBPrebuilt(downloadOptions);

}
}

@@ -92,2 +87,2 @@

}
}
import { MongoBins } from './mongo-bins';
import { IMongoDBDownloadOptions } from 'mongodb-download';
const Debug: any = require('debug');

@@ -6,10 +7,2 @@

export interface IMongoDBDownloadOpts {
platform?: string;
arch?: string;
version?: string;
downloadDir?: string;
http?: any;
}
export class MongodHelper {

@@ -22,3 +15,3 @@ mongoBin: MongoBins;

constructor(commandArguments: string[] = [], downloadOptions?: IMongoDBDownloadOpts) {
constructor(commandArguments: string[] = [], downloadOptions?: Partial<IMongoDBDownloadOptions>) {
if (downloadOptions) {

@@ -25,0 +18,0 @@ this.mongoBin = new MongoBins(COMMAND, commandArguments, {}, downloadOptions);

@@ -5,6 +5,4 @@ const Debug: any = require('debug');

import { homedir as osHomeDir } from 'os';
import { MongoDBDownload } from 'mongodb-download';
import { IMongoDBDownloadOpts } from './mongod-helper';
import { IMongoDBDownloadOptions, MongoDBDownload } from 'mongodb-download';
export class MongoDBPrebuilt {

@@ -14,7 +12,7 @@ private debug: any;

constructor(public mongoDBDownload?: MongoDBDownload | IMongoDBDownloadOpts) {
constructor(public mongoDBDownload?: MongoDBDownload | Partial<IMongoDBDownloadOptions>) {
this.debug = Debug('mongodb-prebuilt-MongoDBPrebuilt');
if (!this.mongoDBDownload || !(this.mongoDBDownload instanceof MongoDBDownload)) {
const downloadOpts: IMongoDBDownloadOpts = this.mongoDBDownload as IMongoDBDownloadOpts || {
const downloadOpts: Partial<IMongoDBDownloadOptions> = this.mongoDBDownload as Partial<IMongoDBDownloadOptions> || {
downloadDir: this.getHomeDirectory()

@@ -82,2 +80,1 @@ };

}

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

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

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

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

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc