Autocorrect Node Linux x64 Musl Binary
raw JSON →This package (`autocorrect-node-linux-x64-musl`) provides the precompiled native binary for `autocorrect-node` tailored for Linux systems using the musl libc library on x64 architecture. `autocorrect-node` is a native Node.js addon built on NAPI.RS, offering fast and efficient text autocorrection, particularly beneficial for copywriting, correcting spaces, words, and punctuation in CJK (Chinese, Japanese, Korean) languages. This specific package is an internal, platform-dependent runtime dependency of the main `autocorrect-node` library and is not intended for direct use by developers. The current stable version for this binary, mirroring its parent package, is 2.14.0. Its release cadence is tightly coupled with the `autocorrect-node` project, typically updating with major `autocorrect-node` releases or when new native build targets are introduced.
Common errors
error Error: The `autocorrect` native module failed to load. ↓
autocorrect-node is installed, which should pull in the correct platform binary as an optionalDependency. If manually installing, make sure autocorrect-node-linux-x64-musl matches your OS and libc variant. Verify Node.js version compatibility. error Error: Cannot find module 'autocorrect-node-linux-x64-musl' ↓
npm install or yarn install in your project root to ensure all dependencies are correctly installed. Check package.json for autocorrect-node and ensure that npm or yarn successfully installed the correct optional dependencies for your platform. Warnings
breaking Major version upgrades of `autocorrect-node` may introduce breaking changes in the native module interface (NAPI), requiring a corresponding update to this binary package. Ensure `autocorrect-node` and its native binaries are kept in sync. ↓
gotcha This package is specifically for `x86_64-unknown-linux-musl`. Installing it on an incompatible system (e.g., glibc-based Linux, macOS, Windows, or a different architecture) will lead to runtime errors when `autocorrect-node` attempts to load the native module. ↓
gotcha Native Node.js modules can sometimes fail to load due to `node-abi` compatibility issues, mismatched Node.js versions, or specific system library versions (like `musl` vs `glibc`). ↓
Install
npm install autocorrect-node-linux-x64-musl yarn add autocorrect-node-linux-x64-musl pnpm add autocorrect-node-linux-x64-musl Imports
- AutoCorrect
import { AutoCorrect } from 'autocorrect-node'; - init
import { init } from 'autocorrect-node'; - autocorrect CLI
yarn autocorrect --stdin 'hello世界'
Quickstart
import { autocorrect } from 'autocorrect-node';
async function runAutocorrect() {
const text = "你好Hello世界";
// This implicitly uses the native binary for correction.
const correctedText = await autocorrect(text);
console.log(`Original: ${text}`);
console.log(`Corrected: ${correctedText}`);
// Example of using the CLI via programmatic execution (for illustration)
// In a real app, you'd typically run this directly from the shell or rely on build tools.
try {
const { exec } = await import('node:child_process');
exec(`echo "${text}" | yarn autocorrect --stdin`, (error, stdout, stderr) => {
if (error) {
console.error(`CLI exec error: ${error.message}`);
return;
}
if (stderr) {
console.error(`CLI stderr: ${stderr}`);
return;
}
console.log(`CLI Corrected: ${stdout.trim()}`);
});
} catch (e) {
console.warn("Cannot run CLI example without 'node:child_process' or yarn/npm in path.", e);
}
}
runAutocorrect().catch(console.error);