Skip to content

Releases: MatthieuLemoine/immersive

v2.0.0

28 Jun 15:51
Compare
Choose a tag to compare

v1.5.0

08 Mar 11:00
Compare
Choose a tag to compare

✨ TS typings

v1.4.2

17 Dec 14:31
Compare
Choose a tag to compare

🐛 Support latest node versions
🐛 Fix missing default export when imported as ESM

v1.3.0

10 Oct 20:19
Compare
Choose a tag to compare

v1.2.0

08 Oct 20:52
Compare
Choose a tag to compare

v1.2.0

✨ Port Node.js 10 REPL into Immersive for a better await support.

v1.1.1

07 Oct 15:12
Compare
Choose a tag to compare

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

07 Oct 14:29
Compare
Choose a tag to compare

v1.1.0

✨ Default export

// Before
import { immersive } from 'immersive'
// Now
import immersive from 'immersive'

v1.0.1

07 Oct 14:27
Compare
Choose a tag to compare

v1.0.1

🐛 Missing name in env

v1.0.0

06 Oct 16:00
Compare
Choose a tag to compare

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