# deployment-history

> A simple tool to keep track of your deployments

Latest version **3.0.0** (published 2024-04-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install deployment-history
pnpm add deployment-history
yarn add deployment-history
bun add deployment-history
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2024-04-09 |
| First published | 2023-10-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mateus |
| Maintainers | great_ape78 |

## Links

- npm: https://www.npmjs.com/package/deployment-history
- Repository: https://github.com/GreatApe78/deployment-history
- Homepage: https://github.com/GreatApe78/deployment-history#readme
- Issues: https://github.com/GreatApe78/deployment-history/issues
- npm.io page: https://npm.io/package/deployment-history

## Recent versions

- 3.0.0 (latest) — 2024-04-09
- 2.0.4 — 2023-12-19
- 2.0.3 — 2023-12-18
- 2.0.2 — 2023-12-18
- 2.0.1 — 2023-12-18
- 2.0.0 — 2023-12-15
- 1.0.7 — 2023-12-15
- 1.0.6 — 2023-10-05
- 1.0.5 — 2023-10-05
- 1.0.4 — 2023-10-05
- 1.0.3 — 2023-10-05
- 1.0.2 — 2023-10-05
- 1.0.1 — 2023-10-05
- 1.0.0 — 2023-10-05

## README

# Deployment history

This npm package contains a util function for storing contract addresses inside artifacts folder in hardhat (can be changed)

## Installation

Install deployment-history as a dev dependency with npm

```bash
  npm install -D deployment-history
```
    

## Usage/Examples

In your scripts/ directory:

```javascript

import { saveDeployment } from "deployment-history";

import { ethers } from 'hardhat';

async function main() {
	const accounts = await ethers.getSigners();
	const network = await ethers.provider.getNetwork();

	console.log('==================================================');

	console.log('Deploying!');
	console.log(`Network: ${network.name}`);

	const YourContractFactory = await ethers.getContractFactory('YourContract');
	const yourContractInstance = await YourContractFactory.deploy();
	const address = await yourContractInstance.getAddress();
	console.log(`Deployed at: ${address}`);
	console.log('==================================================');
	saveDeployment(address,network.name)
}

main().catch((error) => {
	console.error(error);
	process.exitCode = 1;
});

```


## Output

The default output file is inside the .gitignored artifacts folder provided by hardhat as deployment-history.txt

```bash

____________________CONTRACT____________________
Deployed MyContract: 0x1234
Network: rinkeby
Date: Mon Dec 18 2023 10:53:47 GMT-0300 (Brasilia Standard Time)
________________________________________________
____________________CONTRACT____________________
Deployed MyContract: 0x1234
Network: rinkeby
Date: Mon Dec 18 2023 10:57:35 GMT-0300 (Brasilia Standard Time)
________________________________________________


```

---
_Source: https://npm.io/package/deployment-history · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
