
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@spokedev/puzzler
Advanced tools
Puzzler is a low configuration, stateful migration manager for Node.js.
npm install @spokedev/puzzler --save-dev
;
Transaction => A single up/down pair of actions to take.
Migrate => Run a set of up transactions.
Rollback => Run a set of down transactions.
Puzzler expects database credentials to be provided via config file:
config.js:
module.exports = {
database: {
name: 'database name',
host: 'localhost',
port: 26257,
user: 'root',
password: 'unsecurepassword',
pool_size: { min: 0, max: 1 }
}
};
Puzzler will create a migrations history table in your db which contains the history of every migration carried out. This is used to track the current state of the db, and ensure the correct migrations are carried out.
Puzzler supports three actions.
Creates a new template migration file in target directory, with given name.
./node_modules/bin/puzzler make --transactionDir=<transactionDir> --migrationName=addClientTable
[REQUIRED] transactionDir => The location to put the new transaction template.
[OPTIONAL] migrationName => The name to give to the new transaction. Defaults to migration.
Carries out up migrations in timestamp order.
./node_modules/bin/puzzler migrate --transactionDir=<transactionDir> --config=config.js --partial=1
[REQUIRED] transactionDir => The location to source transactions from.
[REQUIRED] config => The location of config file (see Configuration).
[OPTIONAL] partial => Option to carry out a specified number of up transactions. Defaults to 0 (i.e. run all migrations).
Carries out down rollbacks in timestamp order.
./node_modules/bin/puzzler rollback --transactionDir=<transactionDir> --config=config.js --partial=1
[REQUIRED] transactionDir => The location to source transactions from.
[REQUIRED] config => The location of config file (see Configuration).
[OPTIONAL] partial => Option to carry out a specified number of up transactions. Defaults to 0 (i.e. run all migrations).
Puzzler can be used as part of a wider codebase by requiring the module. When used this way it expects to be provided a knex.js connection pool:
const puzzler = require('@spokedev/puzzler');
const knex = require('knex');
const pool = knex({
client: 'pg',
version: '0.0',
connection: {
user: 'user',
password: 'password',
host: 'localhost',
database: 'databaseName',
port: 2567
},
pool: { min: 0, max: 1 }
});
// make a new transaction
puzzler.make({
transactionDir: `${__dirname}/transactions`,
migrationName: 'addClientsTable'
});
// run all migrations
puzzler.migrate({
transactionDir: `${__dirname}/transactions`,
pool: pool,
partial: 0
});
// rollback all migrations
puzzler.rollback({
transactionDir: `${__dirname}/transactions`,
pool: pool,
partial: 0
});
FAQs
A simple db migration manager
The npm package @spokedev/puzzler receives a total of 0 weekly downloads. As such, @spokedev/puzzler popularity was classified as not popular.
We found that @spokedev/puzzler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.