npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aship/core

v0.2.0

Published

Core library for Aship - Ansible management APIs, SSH connections, and configuration handling

Downloads

12

Readme

@aship/core

npm version

Core library for aship, providing APIs and utilities for Ansible management, SSH connections, and configuration handling.

This package contains the core business logic and can be used independently to build custom Ansible management tools.

🏗️ Architecture

This package provides:

  • Configuration Management: Project and server configuration handling with YAML/JSON support
  • Ansible Integration: Playbook execution, inventory management, and parameter handling
  • SSH Management: Connection handling, authentication, and session management
  • Server Management: Server configuration, connection testing, and permission detection
  • Schema Validation: Zod-based validation for all configuration formats
  • Utility Functions: File operations, network connectivity, and retry mechanisms

📦 Installation

Prerequisites

  • Node.js 18.0.0 or higher

Install

# Install as dependency
npm install @aship/core

# Or using pnpm
pnpm add @aship/core

🔧 API Usage

Configuration Management

import { ConfigurationManager, RuntimeConfigManager } from '@aship/core';

// Load project configuration
const configManager = new ConfigurationManager('/path/to/aship.yml');
const config = await configManager.loadConfig();

// Manage runtime configuration (hosts, cache)
const runtimeManager = new RuntimeConfigManager('/path/to/project');
const servers = await runtimeManager.loadServers();

Ansible Execution

import { AnsibleExecutor } from '@aship/core';

// Execute an Ansible playbook
const executor = new AnsibleExecutor();
const result = await executor.executePlaybook({
  servers: [{ hostname: 'example.com', user: 'deploy', port: 22 }],
  playbook: 'playbooks/deploy.yml',
  extraVars: {
    environment: 'production',
    version: '1.2.3'
  },
  ansibleArgs: ['--tags', 'web,database', '--verbose'],
  cwd: '/path/to/project'
});

// Execute Ansible modules directly
const moduleResult = await executor.executeAnsible({
  servers: [{ hostname: 'example.com', user: 'deploy', port: 22 }],
  pattern: 'all',
  module: 'shell',
  args: 'uptime',
  cwd: '/path/to/project'
});

Host Management

import { HostManager, DirectoryManager } from '@aship/core';

// Host management
const directoryManager = new DirectoryManager();
const hostManager = new HostManager(directoryManager);

// Add a host
await hostManager.addHost({
  hostname: 'prod.example.com',
  user: 'deploy',
  port: 22,
  description: 'Production web server',
  source: 'manual'
}, 'production-web');

// Get all hosts
const hosts = await hostManager.getHosts();

SSH Connection Management

import { testConnectionWithRetry, connectToServer } from '@aship/core';

// Test SSH connection
const result = await testConnectionWithRetry({
  hostname: 'example.com',
  user: 'deploy',
  port: 22,
  identity_file: '~/.ssh/id_rsa'
});

// Establish SSH connection
const connection = await connectToServer({
  hostname: 'example.com',
  user: 'deploy',
  port: 22
});

📖 Complete Documentation

For comprehensive documentation, examples, and usage patterns:

📚 Complete Documentation on GitHub

  • API reference and examples
  • Integration guides and patterns
  • Development documentation
  • Example projects using @aship/core

🔗 Related Packages

  • aship - Main user-facing CLI package
  • @aship/cli - CLI implementation package

🧪 Testing

# Run core tests
pnpm test

# Run tests in development mode
pnpm test:dev

🔌 Extensibility

The core package is designed to be extensible:

// Custom configuration manager
class CustomConfigManager extends ConfigurationManager {
  async loadConfig() {
    // Custom configuration loading logic
    return super.loadConfig();
  }
}

// Custom Ansible executor
class CustomAnsibleExecutor extends AnsibleExecutor {
  async executePlaybook(options) {
    // Custom pre-execution logic
    return super.executePlaybook(options);
  }
}

🤝 Contributing

This package is part of the aship project. Please refer to the main project documentation for contribution guidelines.

📄 License

MIT License - see LICENSE for details.