GithubHelp home page GithubHelp logo

sajjathossain / nvim-npm Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 295 KB

A Neovim plugin for JavaScript, TypeScript projects. It provides a way to execute npm scripts without leaving the editor.

Lua 100.00%
monorepo neovim neovim-plugin npm

nvim-npm's Introduction

Nvim NPM

A Neovim plugin for JavaScript, TypeScript projects. It provides a way to execute npm scripts without leaving the editor.

FeaturesScreenshotsInstallationCommandsApiDefault MappingsConfigurationConfiguration options

Features

Execute npm scripts without leaving the editor

Screenshots

  • Search projects that contain a package.json file

search projects

  • Show scripts in a telescope window

search scripts in the project

  • execute script

execute command

Installation

Install the plugin with your favorite package manager:

Plug 'sajjahossain/nvim-npm'
Plug 'akinsho/toggleterm.nvim',
Plug 'nvim-telescope/telescope.nvim'
Plug 'rcarriga/nvim-notify'
use 'sajjahossain/nvim-npm'
use 'akinsho/toggleterm.nvim',
use 'nvim-telescope/telescope.nvim'
use 'rcarriga/nvim-notify'
require('lazy').setup({
  {
    'sajjahossain/nvim-npm',
    config = true,
    dependencies = {
      'nvim-telescope/telescope.nvim',
      'akinsho/toggleterm.nvim',
      'rcarriga/nvim-notify',
    }
  }
})

Commands

Command Description
:InstallPackage Installs a package in the current project
:OpenTerminal Opens one of the available terminals
:RefreshPackageJsonCache Refreshes the package.json cache
:ShowScriptsInTelescope Shows the available scripts in a telescope window

Api

Function Description
require('nvim-npm').exitAllTerminal() Closes all the terminals
require('nvim-npm').exitTerminal() Closes the current terminal
require('nvim-npm').installPackage() Installs a package in the current project
require('nvim-npm').openTerminal() Opens one of the available terminals
require('nvim-npm').showScripts() Shows the available scripts in a telescope window

Default Mappings

Mode Key Action
Normal ;pi Installs a package in the current project
Normal ;pl Lists the available scripts
Normal ;po Opens one of the available terminals
Normal ;pr Refreshes the package.json cache

Configuration

You can configure the plugin by setting the following options:

require('nvim-npm').setup({
    mappings = { -- key mappings [optional]
        t = {}, -- terminal mode mappings
        n = {} -- normal mode mappings
    }
})

Configuration options

Option Type Default Description
mappings table or false default mappings key mappings. set to false to disable default mappings

nvim-npm's People

Contributors

sajjathossain avatar

Stargazers

hebe ⚸ dite avatar Yuta Katayama avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.