conjure-client-javascript-stdio.txt
Branches > main > 2bb8fe1 > files / nvim / pack / plugins / opt / conjure / doc / conjure-client-javascript-stdio.txt
*conjure-client-javascript-stdio*==============================================================================CONTENTS *conjure-client-javascript-stdio-contents* 1. Introduction ........ |conjure-client-javascript-stdio-introduction| 2. Mappings ................ |conjure-client-javascript-stdio-mappings| 3. Configuration ...... |conjure-client-javascript-stdio-configuration|==============================================================================INTRODUCTION *conjure-client-javascript-stdio-introduction*> JavaScript is a versatile scripting language enabling interactive web pages and dynamic application development.Conjure starts a Node REPL within Neovim when you first open aJavaScript file.Please make sure you have Node.js version 10 or above installed.Once you have tree sitter installed and configured (remember to run`:TSInstall javascript` `and :TSInstall typescript` for TypeScript support) you should be able to evaluate forms just like you wouldin any other Conjure supported language. (<localleader>ee, <localleader>er,etc...)Check out `:ConjureSchool` if you're unsure about what evaluation operationsyou can perform.A client addresses Node.js REPL limitations by automatically transformingimport statements into require calls and arrow functions into standardfunction declarations.TypeScript support:1. Install NodeJS(v16 - v22 tested, >22 do not work)2. Install ts-node(v10.9.2 tested)3. Create a minimal config file(tsconfig.json) in the root of a project: { "ts-node": { // ts-node config here } }, "compilerOptions": { "target": "es2022", "module": "es2022" } }4. Try itCaveats:1. When evaluating a file with `<localleader>ef`, it is better to activate `stray out` beforehand to see any errors during evaluation.==============================================================================MAPPINGS *conjure-client-javascript-stdio-mappings*These mappings are the defaults, you can change them as described in|conjure-mappings| and |conjure-configuration|.See |conjure-client-javascript-stdio-configuration| for specific configurationoptions relevant to these mappings.<localleader>cs Start the javascript REPL if it's not running already.<localleader>cS Stop any existing javascript REPL.<localleader>cr Restart a javascript REPL.<localleader>ei Interrupt running command. Same as pressing Ctrl-C in a cmdline REPL.<localleader>ts Toggle stray out.==============================================================================CONFIGURATION *conjure-client-javascript-stdio-configuration*All configuration can be set as described in |conjure-configuration|. *g:conjure#client#javascript#stdio#typescript_cmd`g:conjure#client#javascript#stdio#typescript_cmd` Specifies the command for the TypeScript REPL shell. Default: `"ts-node"` *g:conjure#client#javascript#stdio#javascript_cmd`g:conjure#client#javascript#stdio#javascript_cmd Specifies the command for the JavaScript REPL shell. Default: `"node --experimental-repl-await"` *g:conjure#client#javascript#stdio#mapping#start*`g:conjure#client#javascript#stdio#mapping#start` Start the javascript REPL if it's not running already. Default: `"cs"` *g:conjure#client#javascript#stdio#mapping#stop*`g:conjure#client#javascript#stdio#mapping#stop` Stop any existing javascript REPL. Default: `"cS"` *g:conjure#client#javascript#stdio#mapping#restart*`g:conjure#client#javascript#stdio#mapping#restart` Restart a javascript REPL. Default: `"cr"` *g:conjure#client#javascript#stdio#args*`g:conjure#client#javascript#stdio#args` Args appended to the REPL command. Useful if you need to toggle features off or on in `node` or `ts-node` (which is selected automatically depending on your filetype). `node` automatically includes `--experimental-repl-await` too. Default: `"-i"` *g:conjure#client#javascript#stdio#prompt_pattern*`g:conjure#client#javascript#stdio#prompt_pattern` Lua pattern to identify a new REPL prompt. This match signals to Conjure that the previous evaluation is complete and we're ready to submit more code as well as collect all output prior to the marker as the result. Default: `"> "` *g:conjure#client#javascript#stdio#show_stray_out*`g:conjure#client#javascript#stdio#show_stray_out` It's an option to reveal output from the REPL that didn't appear immediately because it came from a slow or background process. By default, it's switched off to prevent burdening the Conjure log buffer. Default: `"false"`vim:tw=78:sw=2:ts=2:ft=help:norl:et:listchars=