# express-cocaine-service

> Cocained service middleware wrapper for express

Latest version **0.0.7** (published 2014-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install express-cocaine-service
pnpm add express-cocaine-service
yarn add express-cocaine-service
bun add express-cocaine-service
```

## 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.7 |
| Published | 2014-04-24 |
| First published | 2014-01-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Vsevolod Strukchinsky |
| Maintainers | floatdrop |
| Keywords | express, plugin, middleware |

## Links

- npm: https://www.npmjs.com/package/express-cocaine-service
- Repository: https://github.com/floatdrop/express-cocaine-service
- Issues: https://github.com/floatdrop/express-cocaine-service/issues
- npm.io page: https://npm.io/package/express-cocaine-service

## Dependencies (3)

- [cocaine](https://npm.io/package/cocaine.md) ~0.3
- [optimist](https://npm.io/package/optimist.md) ~0.6.0
- [connect-once](https://npm.io/package/connect-once.md) ~0.1.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.7 (latest) — 2014-04-24
- 0.0.6 — 2014-01-26
- 0.0.5 — 2014-01-23
- 0.0.4 — 2014-01-22
- 0.0.3 — 2014-01-22
- 0.0.2 — 2014-01-21

## README

# express-cocaine-service 
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependency Status][depstat-image]][depstat-url]
> Cocaine service middleware wrapper for express

## Cocaine

This module will work only in cocained express applicaion

## Install

`npm install express-cocaine-service --save`

## Example

```js
var app = express();

// with default client
// new cocaine.Client(argv.locator)
app.use(require('express-cocained-service')('geobase', 'uatraits'));

// or with custom client
var Vow = require("vow");
var promises = require("cocaine/lib/client/methods/promises_shim").Vow(Vow);
var methods = require("cocaine/lib/client/methods/promises")(promises);
var cocaine = require("cocaine");
var client = new cocaine.Client(['apefront.tst.ape.yandex.net', 10053], methods)
app.use(require('express-cocained-service')({ client: client }, 'geobase', 'uatraits'));

app.get('/', function (req, res) {
	// Use req.service.geobase and req.service.uatraits
});
```

## API

### express-cocaine-service([options,] service, service, ...)

Request services from cocaine and store put links to them at every request.

## Options

```[options.client]``` — predefined custom cocaine client

See [connect-once options](https://github.com/floatdrop/connect-once).

[npm-url]: https://npmjs.org/package/express-cocaine-service

[npm-url]: https://npmjs.org/package/express-cocaine-service
[npm-image]: https://badge.fury.io/js/express-cocaine-service.png

[travis-url]: http://travis-ci.org/floatdrop/express-cocaine-service
[travis-image]: https://travis-ci.org/floatdrop/express-cocaine-service.png?branch=master

[coveralls-url]: https://coveralls.io/r/floatdrop/express-cocaine-service
[coveralls-image]: https://coveralls.io/repos/floatdrop/express-cocaine-service/badge.png

[depstat-url]: https://david-dm.org/floatdrop/express-cocaine-service
[depstat-image]: https://david-dm.org/floatdrop/express-cocaine-service.png?theme=shields.io

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