# npm-registry-couchapp

> The CouchApp implementation of an npm registry

Latest version **3.0.0** (published 2020-03-12) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install npm-registry-couchapp
pnpm add npm-registry-couchapp
yarn add npm-registry-couchapp
bun add npm-registry-couchapp
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2020-03-12 |
| First published | 2014-04-09 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 305.3 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 615 |
| Author | Isaac Z. Schlueter |
| Maintainers | adam_baldwin, ahmadnassri, claudiahdz, darcyclarke, isaacs, mikemimik, ruyadorno |
| Keywords | npm, registry, couchapp, design, doc, ddoc, couchdb, couch |

## Links

- npm: https://www.npmjs.com/package/npm-registry-couchapp
- Repository: https://github.com/npm/npm-registry-couchapp
- Issues: https://github.com/npm/npm-registry-couchapp/issues
- npm.io page: https://npm.io/package/npm-registry-couchapp

## Dependencies (3)

- [json](https://npm.io/package/json.md) ~9.0.2
- [semver](https://npm.io/package/semver.md) 4
- [couchapp](https://npm.io/package/couchapp.md) ~0.11.0

## Alternatives

- [@cantoo/pdf-lib](https://npm.io/package/@cantoo/pdf-lib.md) — 297.9K weekly downloads
- [datatables.net-buttons](https://npm.io/package/datatables.net-buttons.md) — 200.1K weekly downloads
- [@ckeditor/ckeditor5-export-pdf](https://npm.io/package/@ckeditor/ckeditor5-export-pdf.md) — 167.0K weekly downloads
- [scanbot-web-sdk](https://npm.io/package/scanbot-web-sdk.md) — 15.0K weekly downloads
- [@syncfusion/ej2-angular-pdfviewer](https://npm.io/package/@syncfusion/ej2-angular-pdfviewer.md) — 8.8K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2020-03-12
- 2.6.11-npmo (npmo) — 2015-11-23
- 2.7.4 — 2020-03-12
- 2.7.3 — 2019-07-17
- 2.7.2 — 2019-06-28
- 2.7.1 — 2017-11-03
- 2.7.0 — 2017-08-09
- 2.6.13 — 2017-05-10
- 2.6.12 — 2016-01-21
- 2.6.11 — 2015-06-17
- 2.6.10 — 2015-06-17
- 2.6.9 — 2015-05-08
- 2.6.8 — 2015-05-07
- 2.6.7 — 2015-03-16
- 2.6.6 — 2014-11-14
- … 25 more at https://npm.io/package/npm-registry-couchapp/versions

## README

# npm-registry-couchapp

[![Build Status](https://img.shields.io/travis/npm/npm-registry-couchapp/master.svg)](https://travis-ci.org/npm/npm-registry-couchapp)

__deprecation notice: as npm has scaled, the registry architecture has gradually migrated towards
a complex distributed architecture, of which npm-registry-couchapp is only a small part. FOSS
is an important part of npm, and over time we plan on exposing  more APIs, and [better documenting
the existing API](https://github.com/npm/public-api).__

__npm-registry-couchapp is still a core part of our functionality, but all new registry features are
now added to the micro-services that now make up npm. For this reason, we will not be accepting any
pull requests, or making any changes to this codebase going forward.__

__For issues with the npmjs.com website, please open an issue on the
[npm/www](https://github.com/npm/www) repo. For issues wih the registry
service (for example, slow package downloads, or inability to publish a
package), see the [npm/registry](https://github.com/npm/registry) repo.__

The design doc for The npm Registry CouchApp

# Installing

You need CouchDB version 1.4.0 or higher.  1.5.0 or higher is best.

Once you have CouchDB installed, create a new database:

    curl -X PUT http://localhost:5984/registry

You'll need the following entries added in your `local.ini`

```ini
[couch_httpd_auth]
public_fields = appdotnet, avatar, avatarMedium, avatarLarge, date, email, fields, freenode, fullname, github, homepage, name, roles, twitter, type, _id, _rev
users_db_public = true

[httpd]
secure_rewrites = false

[couchdb]
delayed_commits = false
```

Clone the repository if you haven't already, and cd into it:

    git clone git://github.com/npm/npm-registry-couchapp
    cd npm-registry-couchapp

Now install the stuff:

    npm install

Sync the ddoc to `_design/scratch`

    npm start \
      --npm-registry-couchapp:couch=http://admin:password@localhost:5984/registry

Next, make sure that views are loaded:

    npm run load \
      --npm-registry-couchapp:couch=http://admin:password@localhost:5984/registry

And finally, copy the ddoc from `_design/scratch` to `_design/app`

    npm run copy \
      --npm-registry-couchapp:couch=http://admin:password@localhost:5984/registry

Of course, you can avoid the command-line flag by setting it in your
~/.npmrc file:

    _npm-registry-couchapp:couch=http://admin:password@localhost:5984/registry

The `_` prevents any other packages from seeing the setting (with a
password) in their environment when npm runs scripts for those other
packages.

# Replicating the Registry

To replicate the registry **without attachments**, you can point your
CouchDB replicator at <https://skimdb.npmjs.com/registry>.  Note that
attachments for public packages will still be loaded from the public
location, but anything you publish into your private registry will
stay private.

To replicate the registry **with attachments**, consider using
[npm-fullfat-registry](https://npmjs.org/npm-fullfat-registry).
The fullfatdb CouchDB instance is
[deprecated](http://blog.npmjs.org/post/83774616862/deprecating-fullfatdb).

# Using the registry with the npm client

With the setup so far, you can point the npm client at the registry by
putting this in your ~/.npmrc file:

    registry = http://localhost:5984/registry/_design/app/_rewrite

You can also set the npm registry config property like:

    npm config set \
      registry=http://localhost:5984/registry/_design/app/_rewrite

Or you can simple override the registry config on each call:

    npm \
      --registry=http://localhost:5984/registry/_design/app/_rewrite \
      install <package>

# Optional: top-of-host urls

To be snazzier, add a vhost config:

    [vhosts]
    registry.mydomain.com:5984 = /registry/_design/app/_rewrite

Where `registry.mydomain.com` is the hostname where you're running the
thing, and `5984` is the port that CouchDB is running on. If you're
running on port 80, then omit the port altogether.

Then for example you can reference the repository like so:

    npm config set registry http://registry.mydomain.com:5984

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