This is a utility module for managing Inkdrop packages and themes in the desktop app and other tools.
npm install @inkdropapp/ipmImport:
import { IPM } from '@inkdropapp/ipm'
const options = {
// options for IPM
}
const ipm = new IPM(options)List installed packages:
const installedPackages = await ipm.getInstalled()List outdated packages:
const outdatedPackages = await ipm.getOutdated()name: Name of the package to installversion: Optional specific version to install. If not provided, it installs the latest version.
Install package:
```ts
const result = await ipm.install(package)name: Name of the package to updateversion: Optional specific version to update to. If not provided, it updates to the latest version.
Update package:
```ts
const result = await ipm.update('package-name')Create a symlink for a local package in the Inkdrop packages directory. Useful for plugin development.
packagePath: Path to the local package directoryopts.dev: If true, links todev/packagesinstead ofpackagesopts.name: Override the package name (defaults tonamefrompackage.json, or the directory basename)
Returns the created symlink path.
// Link to packages/
await ipm.link('./my-plugin')
// Link to dev/packages/ for development
await ipm.link('./my-plugin', { dev: true })
// Link with a custom name
await ipm.link('./my-plugin', { dev: true, name: 'custom-name' })Uninstall package:
await ipm.uninstall('package-name')Publish a package to the registry. It will use cwd to locate the package to publish.
dryrun: If true, simulates the publish process without actually publishing. Default isfalse.path: Path to the package directory. If not provided, it uses the current working directory.
await ipm.publish({ dryrun: true, path: './my-package' })Unpublish a package or specific version from the registry.
name: Name of the package to unpublishopts.version: Optional specific version to unpublish. If not provided, unpublishes the entire package.
// Unpublish entire package
await ipm.unpublish('package-name')
// Unpublish specific version
await ipm.unpublish('package-name', { version: '1.0.0' })Get a package from the registry:
const packageInfo = await ipm.registry.getPackageInfo('package-name')name: The name of the package to get
Get information about a specific version of a package:
const versionInfo = await ipm.registry.getPackageVersionInfo('package-name', '1.0.0')name: The name of the packageversion: The specific version to get information for
Search packages with a keyword. Results are filtered to versions compatible with the client's Inkdrop major.
const searchResults = await ipm.registry.search({ q: 'markdown' })q: Search query string
Get packages from the registry:
const packages = await ipm.registry.getPackages({ sort: 'recency', page: 0 })sort: Sort order ('majority', 'recency', 'newness', 'theme-majority', 'theme-recency', 'theme-newness')page: Page number for paginationtheme: Whether to filter for themes only
- Node.js 20.x or higher
- pnpm
pnpm installpnpm test- Run tests (Vitest)pnpm run test:watch- Run tests in watch modepnpm run lint- Run oxlintpnpm run lint:fix- Run oxlint with auto-fixpnpm run format- Format code with oxfmtpnpm run typecheck- Run TypeScript type checkingpnpm run build- Build with tsdown
This project uses GitHub Actions for continuous integration. The CI pipeline runs:
- Tests on Node.js 24.x
- Cross-platform testing (Ubuntu, Windows, macOS)
- Linting with oxlint and format checking with oxfmt
- Type checking with TypeScript
All pull requests must pass CI checks before merging.