This package, `atma-io-middleware-base` (current stable version 1.0.51), serves as a foundational utility for abstracting and creating custom middleware extensions for the `atma-io` library. It simplifies the process of integrating custom file processing logic—such as reading, compiling, or preprocessing files—into the `atma-io` ecosystem. Developers use it to define synchronous `process` or asynchronous `processAsync` methods that transform file content, returning an object with the modified content and an optional source map. Its configuration can be extended via `package.json` under the specific middleware's name. As part of the Atma.js Project, this package's development appears to be inactive, with the last known activity dating back to 2017, suggesting an abandoned or unmaintained status.
npm install atma-io-middleware-baseVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create a custom `atma-io` file middleware using `create`, defining both synchronous and asynchronous `process` methods, and showing its basic structure and conceptual usage.
Consider migrating to actively maintained alternatives if available within the Atma.js ecosystem, or fork the repository to apply necessary updates and security patches.
Ensure `atma-io` is installed and meets the peer dependency requirement (npm i atma-io@^1.1.7).
Review generated types for compatibility with your project's TypeScript configuration and consider adding custom declaration files (`.d.ts`) if necessary for stricter typing or newer features.
Prefer `import { create } from 'atma-io-middleware-base';` in ESM projects. If using CJS in an ESM-dominant project, ensure proper interoperability or transpilation. For older Node.js versions, `const { create } = require('atma-io-middleware-base');` is correct.Install the peer dependency: `npm install atma-io` or `yarn add atma-io`.
Use a named import: `import { create } from 'atma-io-middleware-base';` or for CommonJS: `const { create } = require('atma-io-middleware-base');`Ensure that `process` and `processAsync` methods return an object with at least a `content: string` property, and optionally `sourceMap: string`. Also, correctly type your `options` generic parameter if used.