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

@nuanced-dev/mutagen

v0.19.0-dev.1

Published

Fast file synchronization and network forwarding for remote development

Readme

@nuanced-dev/mutagen

Fast file synchronization and network forwarding for remote development.

This is an NPM wrapper for Mutagen, providing easy installation and usage in Node.js projects.

Installation

npm install @nuanced-dev/mutagen

The package will automatically install the appropriate platform-specific binary for your system.

Supported Platforms

Hosts:

  • macOS (x64, arm64)
  • Linux (x64, arm64)
  • Windows (x64, arm64)

Targets:

  • Linux (x64, arm64)

CLI Usage

After installation, you can use the nuanced-mutagen command:

# Check version
npx nuanced-mutagen version

# Create a sync session
npx nuanced-mutagen sync create /path/to/source user@host:/path/to/destination

# List sync sessions
npx nuanced-mutagen sync list

# Get help
npx nuanced-mutagen help

Programmatic Usage

This package is written in TypeScript and provides full type definitions. You can use Mutagen programmatically in your Node.js/TypeScript projects.

Asynchronous API (spawn-based)

Use the default export mutagen for asynchronous execution (uses child_process.spawn):

import mutagen from '@nuanced-dev/mutagen';

// Execute mutagen asynchronously and pipe output to current process
const proc = mutagen(['version'], { stdio: 'inherit' });

proc.on('exit', (code) => {
  console.log(`Exited with code ${code}`);
});

Synchronous API (spawnSync-based)

Use the named export mutagenSync for synchronous execution (uses child_process.spawnSync):

import { mutagenSync } from '@nuanced-dev/mutagen';

// Execute mutagen synchronously
const result = mutagenSync(['version'], { encoding: 'utf-8' });

if (result.status === 0) {
  console.log(result.stdout);
} else {
  console.error(result.stderr);
}

Examples

Capture output asynchronously:

import mutagen from '@nuanced-dev/mutagen';

const proc = mutagen(['sync', 'list'], { stdio: 'pipe' });

let output = '';
proc.stdout?.on('data', (data) => {
  output += data.toString();
});

proc.on('exit', (code) => {
  if (code === 0) {
    console.log('Sync sessions:', output);
  } else {
    console.error('Failed to list sync sessions');
  }
});

Using async/await with promises:

import mutagen from '@nuanced-dev/mutagen';

function execMutagen(args: string[]): Promise<string> {
  return new Promise((resolve, reject) => {
    const proc = mutagen(args, { stdio: 'pipe' });

    let stdout = '';
    let stderr = '';

    proc.stdout?.on('data', (data) => stdout += data);
    proc.stderr?.on('data', (data) => stderr += data);

    proc.on('exit', (code) => {
      if (code === 0) {
        resolve(stdout);
      } else {
        reject(new Error(`Mutagen exited with code ${code}: ${stderr}`));
      }
    });
  });
}

async function main() {
  try {
    const version = await execMutagen(['version']);
    console.log('Mutagen version:', version.trim());
  } catch (error) {
    console.error('Error:', error instanceof Error ? error.message : String(error));
  }
}

main();

Simple synchronous execution:

import { mutagenSync } from '@nuanced-dev/mutagen';

const result = mutagenSync(['sync', 'list'], { encoding: 'utf-8' });

if (result.status === 0) {
  console.log('Sync sessions:');
  console.log(result.stdout);
} else {
  console.error('Failed to list sync sessions');
  console.error(result.stderr);
}

API

mutagen(args, options) (default export)

Execute mutagen asynchronously with the given arguments (uses child_process.spawn).

Parameters:

  • args (string[], optional): Command-line arguments to pass to mutagen. Default: []
  • options (SpawnOptions, optional): Options to pass to child_process.spawn(). Default: {}

Returns:

  • ChildProcess: The spawned child process

The function returns a Node.js ChildProcess object, giving you full control over:

  • Standard input (proc.stdin)
  • Standard output (proc.stdout)
  • Standard error (proc.stderr)
  • Exit events (proc.on('exit', ...))
  • And all other ChildProcess features

mutagenSync(args, options) (named export)

Execute mutagen synchronously with the given arguments (uses child_process.spawnSync).

Parameters:

  • args (string[], optional): Command-line arguments to pass to mutagen. Default: []
  • options (SpawnSyncOptions, optional): Options to pass to child_process.spawnSync(). Default: {}

Returns:

  • SpawnSyncReturns<Buffer | string>: The result object containing:
    • status: The exit code
    • stdout: Standard output (Buffer or string depending on encoding option)
    • stderr: Standard error (Buffer or string depending on encoding option)
    • error: Error object if the command failed to execute
    • And other properties from SpawnSyncReturns

License

MIT

Links