Releases: MatthieuLemoine/immersive
Releases · MatthieuLemoine/immersive
v2.0.0
💥 Remove standard-things/esm 🔥
v1.5.0
✨ TS typings
v1.4.2
🐛 Support latest node versions
🐛 Fix missing default export when imported as ESM
v1.3.0
v1.2.0
v1.2.0
✨ Port Node.js 10 REPL into Immersive for a better await support.
v1.1.1
v1.1.1
🐛 All immersive applications shared the same configuration
To fix this the new required option projectName
has been added & name
has been renamed to displayName
:
import immersive from 'immersive';
immersive({
// Application name used for config persistence (required)
projectName: 'Immersive',
// Will be displayed on CLI start (optional - default to displayName)
displayName: 'Immersive',
// Path to the directory where commands are defined (required)
commandsDirectory: path.join(__dirname, 'commands'),
})
v1.1.0
v1.1.0
✨ Default export
// Before
import { immersive } from 'immersive'
// Now
import immersive from 'immersive'
v1.0.1
v1.0.1
🐛 Missing name in env
v1.0.0
v1.0.0
First release 🎉
Install
yarn add immersive
or
npm install immersive
Usage
import immersive from 'immersive';
const config = {
// A name that will be displayed on CLI start (optional)
name: 'Immersive',
// Path to the directory where commands are defined (required)
commandsDirectory: path.join(__dirname, 'commands'),
// Will be accessible from commands as argument (optional)
helpers: {
db,
},
// Configuration will be passed to helpers based on the current environment (optional)
environments: {
development: { database: 'devdb' },
staging: { database: 'stagingdb' },
production: { database: 'proddb' },
},
// Define the current environment on CLI start
// The current environment can be changed using the `env <envName>` command (optional)
defaultEnvironment: 'development',
// Default cli config (optional)
defaultConfig: {
// Displayed in prompt
user: 'john',
// Displayed in prompt
symbol: '>',
colors: {
prompt: 'green',
},
},
};
immersive(config);
Features
- Customization
- Config persistence
- Auto loading of commands
- Autocomplete
- Command history
- Async commands support
- Enhanced context for commands
- Environments management
- Enhanced REPL
- Display tables
- Help command