Registry / devops / truffle-latest-migration

truffle-latest-migration

JSON →
library2.0.1jsnpmunverified

A CLI utility that returns the last migration ID Truffle has executed for a given network. Version 2.0.1 (latest, stable). It reads from the Truffle artifacts database (build/contracts/Migrations.json) and outputs the last migration number. Simple, single-purpose tool for Truffle developers who need to programmatically determine which migration was last run. No external dependencies beyond Node.js >=12.

npm install truffle-latest-migration
INSTALL
IMPORT
SIG · TRUFFLE-LATEST-MIG
T
truffle-latest-migration
devopsjavascriptv2.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

truffle-latest-migration
npx truffle-latest-migration --network development
const latestMigration = require('truffle-latest-migration')
This package is a CLI tool, not a library. Use npx or install globally to run directly.

Runs the CLI tool to get the last migration ID for the 'development' network.

npx truffle-latest-migration --network development
Debug
Known issues
gotchaRequires Truffle's build artifacts to be present. Will fail if Migrations.json is missing or network not deployed.
fix
Ensure you have run at least one migration with Truffle on the target network.
affects: >=0.0.0
gotchaThe tool reads from the local file system; it does not query a live network. Deployment must be done locally first.
fix
Run 'truffle migrate' before using this tool.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'truffle-config'
Running outside a Truffle project directory or node_modules not installed.
fix
Run from the root of a Truffle project directory that has truffle installed.
Error: Could not find Migrations.json. Have you run a migration?
No build/contracts/Migrations.json file found for the specified network.
fix
Run 'truffle migrate --network <network>' first.
Upgrade
Version history
2.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
truffle-latest-migration — npm install truffle-latest-migration · libregistry