# npm-atomic-publish

> publish to npm with a single http request

Latest version **0.0.9** (published 2014-01-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install npm-atomic-publish
pnpm add npm-atomic-publish
yarn add npm-atomic-publish
bun add npm-atomic-publish
```

Provides the command `npm-atomic-publish`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2014-01-24 |
| First published | 2013-12-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Dominic Tarr |
| Maintainers | dominictarr |

## Links

- npm: https://www.npmjs.com/package/npm-atomic-publish
- Repository: https://github.com/dominictarr/npm-atomic-publish
- Issues: https://github.com/dominictarr/npm-atomic-publish/issues
- npm.io page: https://npm.io/package/npm-atomic-publish

## Dependencies (7)

- [mkdirp](https://npm.io/package/mkdirp.md) ~0.3.5
- [shasum](https://npm.io/package/shasum.md) ~1.0.0
- [npmconf](https://npm.io/package/npmconf.md) ~0.1.6
- [request](https://npm.io/package/request.md) ~2.27.0
- [npmd-pack](https://npm.io/package/npmd-pack.md) ~1.0.0
- [concat-stream](https://npm.io/package/concat-stream.md) ~1.2.1
- [npm-registry-client](https://npm.io/package/npm-registry-client.md) ~0.2.30

## Recent versions

- 0.0.9 (latest) — 2014-01-24
- 0.0.8 — 2013-12-14
- 0.0.7 — 2013-12-14
- 0.0.5 — 2013-12-11
- 0.0.4 — 2013-12-11
- 0.0.3 — 2013-12-11
- 0.0.2 — 2013-12-11
- 0.0.1 — 2013-12-11

## README

# npm-atomic-publish

publish a module with a single http request.

in recent npm versions npm also uses an atomic publish,
pretty much just like this, but not exactly.

# how this works.

1. *CHECK_CACHE* check for `~/.npm/{module_name}/.cache.json`,  
   if it's not present, assume it's a new module and goto *DEFAULTS*, else, goto *PUBLISH*  

2. *DEFAULTS* set up the doc for a fresh publish. goto *PUBLISH*

3. *PUBLISH* add the tarball inline to the document,  
   and attempt to push to the registry.  
   If you get 2xx goto *DONE*.  
   If there was an error, and this was the first time you tried goto *UPDATE_CACHE*,  
   else it's the second time you have tried to publish, then goto *ABORT*.

4. *UPDATE_CACHE* do a get request for the module, and update the cache.  
   If this fails with a 404, goto *DEFAULTS* (this will only happen after an unpublish)  
   If it succeeds, goto *PUBLISH*, else goto *ABORT*  

5. *ABORT* post an issue!

6. *DONE* write another module!

# Usage

``` js
npm install -g npm-atomic-publish

cd your-module/
npm-atomic-publish
```

## License

MIT

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