Skip to content
/ knexup Public

A cli project starter/helper to get up and running with Knex.js projects.

License

Notifications You must be signed in to change notification settings

ikmich/knexup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

knexup

A cli project starter/helper to get up and running with Knex.js projects.

Installation

npm i -g knexup

# or 
yarn global add knexup

Usage

Start with knexup init

This should be the first thing when using knexup in an existing project.

This generates the knexup config file in the project. Open the config file and edit/confirm your preferred knex location (knexDir). This is where knex files and other featured helpers will be generated.

knexup bootstrap

Generates files and installs dependencies for working with knex.js in an existing project.

knexup table-init

Generates TableInit schema-creation helper objects for each table specified via the -t | --table flag. The "table-init" sub-command argument can be omitted also, in which case the arguments after that will serve as the tables input.

The examples below will generate a TableInit helper object for the "user" table.

knexup table-init user
knexup -t user

To bootstrap a new project, use knexup project <projectName>

Bootstrap a new project for working with knex.js.

  • Pass the -d, --databaseClient flag to specify which database client driver dependency to install. You can specify any client supported by Knex.
  • Pass the -p, --path flag to specify the path where the project should be created. If not specified, it defaults to the current directory in which the command is run.

knexup help

See help info

Options:
  -p, --path <char>             Path relative to project root.
  -t, --table [tables...]       Database table name(s).
  -d, --database-client <char>  The preferred database client (mysql|postgres|sqlite)
  -h, --help                    display help for command

Commands:
  init                          Initialize a project for Knex development. Generates TableInit migration helper object for table "create" migration. Also creates a knexup config file if it does not exist.
  project <projectName>         Generate a project based on knex.js
  bootstrap                     Generates files and installs dependencies for working with knex.js.
  table-init                    Generates table-init schema-creation helpers for each table specified via --table
  help [command]                display help for command

Dependencies Installed

The following runtime dependencies are installed by the knexup project command:

The following dev dependencies are auto-installed by the knexup project command:

The following runtime dependencies are installed by the knexup bootstrap command:

The following dev dependencies are installed by the knexup bootstrap command:

Changelogs

See changelogs here

About

A cli project starter/helper to get up and running with Knex.js projects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published