npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@chemzqm/neovim

v6.1.2

Published

NodeJS client API for vim8 and neovim

Downloads

9,104

Readme

neovim-client

Fork of neovim/node-client which works on both vim8 and neovim.

Currently works on node >= 8.

This module is used by coc.nvim, you can this module to create extension for vim8 and neovim, but it's recommended to build extension for coc.nvim.

Installation

Install the neovim package globally using npm.

npm install -g @chemzqm/neovim

Build from source code

Git clone then run yarn install.

API

import {attach, NeovimClient} from '@chemzqm/neovim'
// attach option could be ReadableStream & WritableStream or ChildProcess or socket string
const nvim: NeovimClient = attach({
  reader: process.stdin,
  writer: process.stdout
})
// current buffer object
let buf = await nvim.buffer
// current window object
let win = await nvim.window
// current tabpage object
let tabpage = await nvim.tabpage

Debug on vim8

Build this module from source code, in root of project folder, start the server by command: vim -u mini.vim.

Checkout the vim8's log file by :Openlog command.

Checkout log of node-client by open the file $XDG_RUNTIME_DIR/node-client.log.

To change the behavior, change the file mini.vim and ./bin/server.js which are used for test purpose.

Debugging / troubleshooting

Default location for log file would be $XDG_RUNTIME_DIR/node-client.log.

Use $NODE_CLIENT_LOG_FILE to specify full path of the log.

Use $NODE_CLIENT_LOG_LEVEL to specify the log level, which default to info, could also be debug or trace.

Use let g:node_client_debug = 1 in vim8 to enable logfile of vim8, use :call nvim#rpc#open_log() to open vim8 logfile.

Usage through node REPL

Note, it only works with neovim, you also need build this module from source code.

NVIM_LISTEN_ADDRESS

First, start Nvim with a known address (or use the $NVIM_LISTEN_ADDRESS of a running instance):

NVIM_LISTEN_ADDRESS=/tmp/nvim nvim

In another terminal, cd to root of this module then start node REPL by:

NVIM_LISTEN_ADDRESS=/tmp/nvim node

connect to Nvim:

let nvim
// `scripts/nvim` will detect if `NVIM_LISTEN_ADDRESS` is set and use that unix socket
require('./scripts/nvim').then(n => (nvim = n))

nvim.command('vsp')

LICENSE

MIT