singleton-tsserver
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

singleton-tsserver

单实例的 tsserver

NPM version build status Test coverage David deps Known Vulnerabilities npm download

针对同样的参数,只启动一个 tsserver 实例

用法

const ClusterTsServerProcess = require('singleton-tsserver');
 
const options = {
  tsServerPath: '<tsServerPath>',
  args: [
    '--useInferredProjectPerProjectRoot',
    '--enableTelemetry',
    '--noGetErrOnBackgroundUpdate',
    '--validateDefaultNpmLocation',
  ],
};
 
const proc = new ClusterTsServerProcess(options);
proc.stdout.on('data', data => {
  console.log(data.toString());
});
 
proc.write({
  seq: 0,
  type: 'request',
  command: 'configure',
  arguments: {
    hostInfo: 'vscode',
    preferences: {
      providePrefixAndSuffixTextForRename: true,
      allowRenameOfImportPath: true,
    },
  },
});

Readme

Keywords

Package Sidebar

Install

Weekly Downloads

4

Version

1.0.1

License

MIT

Unpacked Size

26.6 kB

Total Files

13

Last publish

Collaborators

  • gxcsoccer