
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
A wrapper to spawn mongoimport/export processes
const Spawngo = require('spawngo')
// create a new instance
let spawngo = new Spawngo({
user: 'foo',
pw: 'bar',
'collection': 'bang'
})
// call #import() function and pass a file to import into mongoDb
// this will return a child process object
let childProcess = spawngo.import('my.json')
// handle events as needed
childProcess.stdout.on('data', function (data) {
// block to handle stdout
})
childProcess.stderr.on('data', function (data) {
// block to handle stderr
})
childProcess.on('close', function (data) {
// block to handle close
})
Note that mongoDb sends ALL status updates to stderr, so to better determine if your process was successful, you should ensure the status code from theclose
event returned a 0, and not rely on stderr
.
Exporting is nearly identical to the above, but instead of import()
, you would call export()
to export the collection as defined when spawngo was instantiated, or updated using .set()
let childProcess = spawngo.export()
If you wish to export a different collection, but not alter the internal configurated collection, you can pass a string of the target collection,:
let childProcess = spawngo.export('collectionName')
Constructor(options) options (Object): Configuration object. Allowed properties are as follows (displayed with default values)
true
undefined
false
Instead of passing options
to constructor, you can also apply your settings by using the .set()
function.
If no user and password are set, then the call to mongoimport
will not use authentication.
import(fileName)
fileName (String): Path of the json/csv/tsv file to import
returns: ChildProcess of the spawned query.
export(collection)
collection (String [optional]): Name of the collection to export. The exported json
file will be named after the collection (i.e collectionName.json
).
The string
aurgument is optional. Not passing a string will use the collect as defined internally either via the constructor
settings, or from using .set()
.
Note that passsing a collection string in this manner will NOT alter the internal configuration.
returns: ChildProcess of the spawned query.
set(optsObj or key, value)
optsObj (Object): Configuration object. See Constructor
above to see all available options.
key (String), value (String): to update a single congiguration property, you may pass a key/value pair of strings as an argument: spawngo.set('collection', 'myThings')
.
returns: The spawngo instance.
FAQs
Spawn a child process for mongoimport/export
The npm package spawngo receives a total of 11 weekly downloads. As such, spawngo popularity was classified as not popular.
We found that spawngo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.