{"name":"@codemirror/lang-javascript","version":"0.19.5","keywords":["editor","code"],"author":{"url":"http://marijnhaverbeke.nl","name":"Marijn Haverbeke","email":"marijnh@gmail.com"},"license":"MIT","_id":"@codemirror/lang-javascript@0.19.5","maintainers":[{"name":"adrianheine","email":"mail@adrianheine.de"},{"name":"marijn","email":"marijnh@gmail.com"}],"homepage":"https://github.com/codemirror/lang-javascript#readme","bugs":{"url":"https://github.com/codemirror/lang-javascript/issues"},"dist":{"shasum":"3c4cb6388489cd298cd8b4755ef16f11172fd77f","tarball":"http://registry-npm.ywwl.com/@codemirror/lang-javascript/download/@codemirror/lang-javascript-0.19.5.tgz","fileCount":8,"integrity":"sha512-W21z2sOFPlimQ3tpevB+thZp7rztDMoXYLjWjCznxYfKRB/QEkFFqJ6U2d/pikIil6qhD4GgAkT72OBxsDuIQQ==","signatures":[{"sig":"MEUCIQDAxLeAmcgAeXCgr8Hbh1BFcrPJ90zG2JFFm/S9H4O4dQIgRQHkMpFf7v5yKMFzFXt2fSi23NH+Ho1re8Ra51vNmeU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33014,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3WP4CRA9TVsSAnZWagAARYMP+QDSO687KscsEGBP5iN3\nySIuh9lFKVZUzrKMTiQHB8DvVjXUIqWhM2yWC8X9z5kyM34ryQuDEiu3yEip\n6ankRL2fvZ6slme/R1A+Tc3Vg4LH+U1A9vds/+ICF909je7d7yqftvr5CAWC\nk5CmDgkeE0oNMFBjtdV0UKD0jdhqukNPspJOau+CRnjozzyPNb6D2JE+omY2\nGimu3Hz+gQ/LbxpkFtIqJq1dwDotRCBWLzaU6H+VFB99ohgQoUZ9CfC5+Zs6\nOICN7zNdwY6roUohk3XjqNVkMw4osfwHEEfAltAv0x9KIuZQ+yGia6hFZZE8\nFKmARdcJBIwVvJfBMsooJ5Uoy4RspCEJwdGCmIDKxQDKmTAPDidBkFCxlVGt\nbGSm1WBYxlUy6kabQLJr1Usqv941FTkpQDBp3XRxpgsMdMQQXCxVj45QtScV\n5RaEzoZHOk084CMba4rITnhoFLdxdiY3OG2e4Y5SS18ffi5ZZxxidRE7Eqlg\n+5SAC7SGIx3ewPrC0EuTDkLTkww9eA3oSrInzx5sZO9SjGK/45+aEscCqYvl\nb3T8WcNdAUqpfrqrdSvuqxBNL6eNTONS/QtcYQKNpFHUE/sbcXIE4RNgvEzK\nKaKXWOtls3B4vSmBqY59s1BqwqiPHuwEFyXlUsW7BY3S+85aaE0CVVnWaIGy\nbLbo\r\n=L/Mw\r\n-----END PGP SIGNATURE-----\r\n","size":6992,"noattachment":false,"key":"/@codemirror/lang-javascript/-/@codemirror/lang-javascript-0.19.5.tgz"},"main":"dist/index.cjs","type":"module","types":"dist/index.d.ts","module":"dist/index.js","exports":{"import":"./dist/index.js","require":"./dist/index.cjs"},"gitHead":"a0ede8b470b6a1c6e593808f3e7d26958ce74ea9","scripts":{"test":"cm-runtests","prepare":"cm-buildhelper src/index.ts"},"_npmUser":{"name":"marijn","email":"marijnh@gmail.com"},"repository":{"url":"git+https://github.com/codemirror/lang-javascript.git","type":"git"},"_npmVersion":"8.1.2","description":"JavaScript language support for the CodeMirror code editor","directories":{},"sideEffects":false,"_nodeVersion":"16.13.1","dependencies":{"@codemirror/lint":"^0.19.0","@codemirror/view":"^0.19.0","@codemirror/state":"^0.19.0","@lezer/javascript":"^0.15.1","@codemirror/language":"^0.19.0","@codemirror/highlight":"^0.19.7","@codemirror/autocomplete":"^0.19.0"},"_hasShrinkwrap":false,"devDependencies":{"@lezer/lr":"^0.15.0","@codemirror/buildhelper":"^0.1.5"},"_npmOperationalInternal":{"tmp":"tmp/lang-javascript_0.19.5_1641899000268_0.7655229107184769","host":"s3://npm-registry-packages"},"readme":"<!-- NOTE: README.md is generated from src/README.md -->\n\n# @codemirror/lang-javascript [![NPM version](https://img.shields.io/npm/v/@codemirror/lang-javascript.svg)](https://www.npmjs.org/package/@codemirror/lang-javascript)\n\n[ [**WEBSITE**](https://codemirror.net/) | [**ISSUES**](https://github.com/codemirror/dev/issues) | [**FORUM**](https://discuss.codemirror.net/c/next/) | [**CHANGELOG**](https://github.com/codemirror/lang-javascript/blob/main/CHANGELOG.md) ]\n\nThis package implements JavaScript language support for the\n[CodeMirror](https://codemirror.net/) code editor.\n\nThe [project page](https://codemirror.net/) has more information, a\nnumber of [examples](https://codemirror.net/examples/) and the\n[documentation](https://codemirror.net/docs/).\n\nThis code is released under an\n[MIT license](https://github.com/codemirror/lang-javascript/tree/main/LICENSE).\n\nWe aim to be an inclusive, welcoming community. To make that explicit,\nwe have a [code of\nconduct](http://contributor-covenant.org/version/1/1/0/) that applies\nto communication around the project.\n\n## Usage\n\n```javascript\nimport {EditorView, basicSetup} from \"codemirror\"\nimport {javascript} from \"@codemirror/lang-javascript\"\n\nconst view = new EditorView({\n  parent: document.body,\n  doc: `console.log(\"Hello world\")`,\n  extensions: [basicSetup, javascript()]\n})\n```\n\n## API Reference\n\n<dl>\n<dt id=\"user-content-javascript\">\n  <code><strong><a href=\"#user-content-javascript\">javascript</a></strong>(<a id=\"user-content-javascript^config\" href=\"#user-content-javascript^config\">config</a>&#8288;?: {jsx&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\">boolean</a>, typescript&#8288;?: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean\">boolean</a>} = {}) → <a href=\"https://codemirror.net/docs/ref#language.LanguageSupport\">LanguageSupport</a></code></dt>\n\n<dd><p>JavaScript support. Includes <a href=\"#user-content-snippets\">snippet</a>\nand local variable completion.</p>\n</dd>\n<dt id=\"user-content-javascriptlanguage\">\n  <code><strong><a href=\"#user-content-javascriptlanguage\">javascriptLanguage</a></strong>: <a href=\"https://codemirror.net/docs/ref#language.LRLanguage\">LRLanguage</a></code></dt>\n\n<dd><p>A language provider based on the <a href=\"https://github.com/lezer-parser/javascript\">Lezer JavaScript\nparser</a>, extended with\nhighlighting and indentation information.</p>\n</dd>\n<dt id=\"user-content-typescriptlanguage\">\n  <code><strong><a href=\"#user-content-typescriptlanguage\">typescriptLanguage</a></strong>: <a href=\"https://codemirror.net/docs/ref#language.LRLanguage\">LRLanguage</a></code></dt>\n\n<dd><p>A language provider for TypeScript.</p>\n</dd>\n<dt id=\"user-content-jsxlanguage\">\n  <code><strong><a href=\"#user-content-jsxlanguage\">jsxLanguage</a></strong>: <a href=\"https://codemirror.net/docs/ref#language.LRLanguage\">LRLanguage</a></code></dt>\n\n<dd><p>Language provider for JSX.</p>\n</dd>\n<dt id=\"user-content-tsxlanguage\">\n  <code><strong><a href=\"#user-content-tsxlanguage\">tsxLanguage</a></strong>: <a href=\"https://codemirror.net/docs/ref#language.LRLanguage\">LRLanguage</a></code></dt>\n\n<dd><p>Language provider for JSX + TypeScript.</p>\n</dd>\n<dt id=\"user-content-autoclosetags\">\n  <code><strong><a href=\"#user-content-autoclosetags\">autoCloseTags</a></strong>: <a href=\"https://codemirror.net/docs/ref#state.Extension\">Extension</a></code></dt>\n\n<dd><p>Extension that will automatically insert JSX close tags when a <code>&gt;</code> or\n<code>/</code> is typed.</p>\n</dd>\n<dt id=\"user-content-snippets\">\n  <code><strong><a href=\"#user-content-snippets\">snippets</a></strong>: readonly <a href=\"https://codemirror.net/docs/ref#autocomplete.Completion\">Completion</a>[]</code></dt>\n\n<dd><p>A collection of JavaScript-related\n<a href=\"https://codemirror.net/docs/ref/#autocomplete.snippet\">snippets</a>.</p>\n</dd>\n<dt id=\"user-content-typescriptsnippets\">\n  <code><strong><a href=\"#user-content-typescriptsnippets\">typescriptSnippets</a></strong>: <a href=\"https://codemirror.net/docs/ref#autocomplete.Completion\">Completion</a>[]</code></dt>\n\n<dd><p>A collection of snippet completions for TypeScript. Includes the\nJavaScript <a href=\"#user-content-snippets\">snippets</a>.</p>\n</dd>\n<dt id=\"user-content-localcompletionsource\">\n  <code><strong><a href=\"#user-content-localcompletionsource\">localCompletionSource</a></strong>(<a id=\"user-content-localcompletionsource^context\" href=\"#user-content-localcompletionsource^context\">context</a>: <a href=\"https://codemirror.net/docs/ref#autocomplete.CompletionContext\">CompletionContext</a>) → <a href=\"https://codemirror.net/docs/ref#autocomplete.CompletionResult\">CompletionResult</a> | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null\">null</a></code></dt>\n\n<dd><p>Completion source that looks up locally defined names in\nJavaScript code.</p>\n</dd>\n<dt id=\"user-content-completionpath\">\n  <code><strong><a href=\"#user-content-completionpath\">completionPath</a></strong>(<a id=\"user-content-completionpath^context\" href=\"#user-content-completionpath^context\">context</a>: <a href=\"https://codemirror.net/docs/ref#autocomplete.CompletionContext\">CompletionContext</a>) → {path: readonly <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">string</a>[], name: <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String\">string</a>} | <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null\">null</a></code></dt>\n\n<dd><p>Helper function for defining JavaScript completion sources. It\nreturns the completable name and object path for a completion\ncontext, or null if no name/property completion should happen at\nthat position. For example, when completing after <code>a.b.c</code> it will\nreturn <code>{path: [&quot;a&quot;, &quot;b&quot;], name: &quot;c&quot;}</code>. When completing after <code>x</code>\nit will return <code>{path: [], name: &quot;x&quot;}</code>. When not in a property or\nname, it will return null if <code>context.explicit</code> is false, and\n<code>{path: [], name: &quot;&quot;}</code> otherwise.</p>\n</dd>\n<dt id=\"user-content-scopecompletionsource\">\n  <code><strong><a href=\"#user-content-scopecompletionsource\">scopeCompletionSource</a></strong>(<a id=\"user-content-scopecompletionsource^scope\" href=\"#user-content-scopecompletionsource^scope\">scope</a>: any) → <a href=\"https://codemirror.net/docs/ref#autocomplete.CompletionSource\">CompletionSource</a></code></dt>\n\n<dd><p>Defines a <a href=\"https://codemirror.net/docs/ref/#autocomplete.CompletionSource\">completion source</a> that\ncompletes from the given scope object (for example <code>globalThis</code>).\nWill enter properties of the object when completing properties on\na directly-named path.</p>\n</dd>\n<dt id=\"user-content-eslint\">\n  <code><strong><a href=\"#user-content-eslint\">esLint</a></strong>(<a id=\"user-content-eslint^eslint\" href=\"#user-content-eslint^eslint\">eslint</a>: any, <a id=\"user-content-eslint^config\" href=\"#user-content-eslint^config\">config</a>&#8288;?: any) → fn(<a id=\"user-content-eslint^returns^view\" href=\"#user-content-eslint^returns^view\">view</a>: <a href=\"https://codemirror.net/docs/ref#view.EditorView\">EditorView</a>) → <a href=\"https://codemirror.net/docs/ref#lint.Diagnostic\">Diagnostic</a>[]</code></dt>\n\n<dd><p>Connects an <a href=\"https://eslint.org/\">ESLint</a> linter to CodeMirror's\n<a href=\"https://codemirror.net/docs/ref/#lint\">lint</a> integration. <code>eslint</code> should be an instance of the\n<a href=\"https://eslint.org/docs/developer-guide/nodejs-api#linter\"><code>Linter</code></a>\nclass, and <code>config</code> an optional ESLint configuration. The return\nvalue of this function can be passed to <a href=\"https://codemirror.net/docs/ref/#lint.linter\"><code>linter</code></a>\nto create a JavaScript linting extension.</p>\n<p>Note that ESLint targets node, and is tricky to run in the\nbrowser. The\n<a href=\"https://github.com/UziTech/eslint-linter-browserify\">eslint-linter-browserify</a>\npackage may help with that (see\n<a href=\"https://github.com/UziTech/eslint-linter-browserify/blob/master/example/script.js\">example</a>).</p>\n</dd>\n</dl>\n","publish_time":1641899000401,"_cnpm_publish_time":1641899000401,"dist-tags":{"latest":"6.2.5"}}