Registry / testing / asm.js-lint

asm.js-lint

JSON →
library0.1.3jsnpmunverified

asm.js-lint is a linting plugin for CodeMirror that validates asm.js code. Version 0.1.3, released around 2013, is the latest stable release. The package is minimal and designed to be used alongside CodeMirror's existing lint addon. It provides a helper script for validation and requires browserification for development. This plugin is rarely updated and has limited adoption, serving as a niche tool for asm.js development within CodeMirror.

npm install asm.js-lint
INSTALL
IMPORT
SIG · ASM.JS-LINT
A
asm.js-lint
testingjavascriptv0.1.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

asm-lint
Include script tag: <script src="<path-to>/asm.js-lint/lib/asm-lint.js"></script>
Using npm package without proper script loading
This library is not a standard npm module; it must be loaded as a script in the browser.
asm-lint-helper
Include script tag: <script src="<path-to>/asm.js-lint/dist/asm-lint-helper.compiled.js"></script>
Requiring via Node.js require()
The helper is a browserified script; it cannot be used in Node.js.
CodeMirror.asmLint
Use the 'asm' lint option: CodeMirror.fromTextArea(element, { mode: 'asm', lint: true })
Using 'asm' as a mode without enabling lint
The plugin registers itself as a lint source for the 'asm' mode in CodeMirror.

Shows how to set up asm.js linting in CodeMirror with script tags and configuration.

// Ensure you have CodeMirror and its lint addon included. // Then add script tags: // <script src="path/to/codemirror.js"></script> // <script src="path/to/addon/lint/lint.js"></script> // <script src="path/to/asm.js-lint/lib/asm-lint.js"></script> // <script src="path/to/asm.js-lint/dist/asm-lint-helper.compiled.js"></script> // // Initialize CodeMirror with asm linting: var editor = CodeMirror.fromTextArea(document.getElementById('code'), { mode: 'asm', lint: true });
Debug
Known issues
deprecatedProject is no longer maintained. Use it at your own risk.
fix
Consider using a modern linting tool for JavaScript asm.js modules.
affects: *
gotchaThe package does not list CodeMirror as a peer dependency, leading to potential version mismatches.
fix
Ensure you manually install a compatible version of CodeMirror.
affects: 0.1.3
gotchaThe library requires browserify for development builds, which may not be obvious.
fix
Run 'browserify src/asm-lint-helper.js -o dist/asm-lint-helper.compiled.js' after installing asm.js.
affects: 0.1.3
gotchaThe plugin only works in browser environments; Node.js usage is unsupported.
fix
Use only in browser-based CodeMirror instances.
affects: *
Errors
Common errors & fixes
Cannot find module 'asm.js'
Development build requires asm.js to be installed globally or locally.
fix
Run 'npm install asm.js' before browserifying.
Uncaught TypeError: Cannot read property 'asm' of undefined
CodeMirror's lint addon has not been loaded before asm-lint.js.
fix
Ensure the script tag for 'addon/lint/lint.js' is included before asm-lint.js.
asm-lint.js requires a CodeMirror instance
asm-lint.js expects CodeMirror to be globally available.
fix
Load CodeMirror as a script tag before asm-lint.js.
Upgrade
Version history
0.1.3latest on npm
Audit
Dependencies
CodeMirroroptionalRequired as a host for the lint plugin, though not listed as a peer dependency.
asm.jsoptionalRequired for building the helper script with browserify.
Agent activity
19 hits · last 30 days
node
17
OpenAI (training)
2
Resources