Skip to content
poise52Public

About

A fast JavaScript package manager written in Rust.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

49 Commits

Folders and files

Repository files navigation

amae

A fast JavaScript package manager written in Rust.

amae resolves, downloads, and links your dependencies the same way npm does — but stores every file exactly once on disk and uses hard links to wire packages into node_modules. No duplicates, no copies, just pointers.


Why

npm copies files. amae doesn't.

Every package you install goes into a global content-addressable store at ~/.amae/store. When the same file is needed in ten different projects, it lives on disk once and is hard-linked into each node_modules. Installs after the first are near-instant because there's nothing to download or unpack — only links to create.

The resolved dependency graph is stored using a hybrid system: a human-readable text lockfile (amae-lock.json) for Git tracking and merge-conflict resolution, and a local binary cache (amae-lock.bin) serialized using bincode for ultra-fast startup.


Install

npm install -g amae-cli

Or with npx (no install needed):

npx amae-cli install

Prebuilt native binaries ship for:

  • macOS arm64 (Apple Silicon)
  • macOS x64 (Intel)
  • Linux x64
  • Windows x64

Usage

amae --version                   # Show amae version
amae install                     # Install all dependencies from package.json
amae install --frozen-lockfile   # Fail if lockfile is out of sync or missing (CI)
amae install --production        # Skip devDependencies (production builds)
amae install --store-dir=./cache # Use a custom local store instead of ~/.amae/store
amae add axios                   # Add a package and install
amae add -D vitest               # Add a dev dependency
amae remove axios                # Remove a package and reinstall
amae update                      # Update all dependencies to their latest versions (semver)
amae update axios                # Update a specific package and its transitives
amae outdated                    # List dependencies that are out of date
amae why axios                   # Traces and prints why a package is installed
amae completions zsh             # Generate shell completion scripts (bash/zsh/fish...)
amae run build                   # Run a script from package.json
amae test                        # Run the "test" script
amae start                       # Run the "start" script
amae list                        # List installed packages with resolved versions
amae clean                       # Delete node_modules and lockfiles
amae prune                       # Clear the global ~/.amae/store cache

Workspaces

amae understands monorepos. It reads "workspaces" from the root package.json or pnpm-workspace.yaml and resolves local packages directly without touching the registry.

my-monorepo/
├── package.json            # { "workspaces": ["packages/*"] }
├── packages/
│   ├── math-utils/
│   │   └── package.json    # { "name": "math-utils", "version": "1.0.0" }
│   └── calc-app/
│       └── package.json    # { "dependencies": { "math-utils": "workspace:*" } }
amae install
# math-utils symlinked directly to packages/math-utils — no registry request
# external packages downloaded once, hard-linked everywhere

Scripting & Configuration (Lua & JavaScript/TypeScript)

amae integrates powerful, native scripting engines to allow fully customizable configurations, execution hooks, and fast scripting.

1. Lua Integration (amae.config.lua)

You can define project-scoped settings and execute custom lifecycle hooks using Lua. amae embeds the Lua runtime (mlua) directly into the binary.

-- amae.config.lua
return {
  registry = "https://registry.npmjs.org/",
  deny_weak_hashes = true,

  -- Custom lifecycle hooks
  preinstall = function()
    print("Preparing project environment in Lua...")
  end,
  postinstall = function()
    print("Install complete! Doing cleanup...")
  end
}

2. Embedded JS/TS V8 Runtime (amae run)

amae features an embedded V8 JavaScript runtime (deno_core) and a blazing-fast TypeScript parser/transpiler (Oxc). You can run .js and .ts scripts directly using amae run:

# Transpiles and executes TS natively using embedded V8, bypassing Node.js startup times
amae run script.ts

How it works

amae install
  │
  ├─ 1. Read package.json (and all workspace packages if monorepo)
  │
  ├─ 2. Resolve — async semver resolution against npm registry
  │      Workspace packages are resolved locally, skipping the network
  │
  ├─ 3. Download — parallel .tgz fetching with SHA integrity check
  │      Each package extracted once into ~/.amae/store/<name>@<version>/
  │      Store is set read-only after extraction to prevent corruption
  │
  ├─ 4. Link — hard links from store into node_modules/.store/
  │      Symlinks from node_modules/<name> → .store/<name>@<version>/
  │      Binaries linked into node_modules/.bin/
  │
  └─ 5. Lifecycle — preinstall / install / postinstall scripts run
         in topological dependency order

The dependency graph is saved to both amae-lock.json (tracked in Git) and amae-lock.bin. On subsequent runs, amae reads the binary lockfile directly for instant startup. If amae-lock.json is newer (e.g. after a git pull) or the binary is missing (e.g. after a clean git clone), the binary cache is automatically rebuilt from the JSON lockfile.


.npmrc

amae reads both local .npmrc and ~/.npmrc. Private registries, scoped registries, and auth tokens work out of the box:

registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=your_token_here

# Scoped registry for @mycompany packages
@mycompany:registry=https://npm.mycompany.com/

Build from source

git clone https://github.com/poise52/amae
cd amae
cargo build --release
./target/release/amae install

Requires Rust 1.75+.


License

MIT

Поддержать разработчика

USDT BEP 0x46922F2abf0eA51E255C6a62bC8Fb71e604Bad76

USDT ERC 0x46922F2abf0eA51E255C6a62bC8Fb71e604Bad76

USDT TRC TG7rYQM4nsC293Eg7cJ1ph1kguLh1A8xCV

BTC bc1q5zmn5f3egeja9v9fwdjn2ld773k4sq0wv8csh3

ETH 0x46922F2abf0eA51E255C6a62bC8Fb71e604Bad76

About

A fast JavaScript package manager written in Rust.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages