# comet-server

> A easy use comet api implement.

Latest version **0.0.4** (published 2015-05-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install comet-server
pnpm add comet-server
yarn add comet-server
bun add comet-server
```

## 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.4 |
| Published | 2015-05-01 |
| First published | 2015-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Mmis1000 |
| Maintainers | mmis1000 |

## Links

- npm: https://www.npmjs.com/package/comet-server
- Repository: git@github.com:mmis1000/node-comet
- Homepage: https://github.com/mmis1000/node-comet
- Issues: https://github.com/mmis1000/node-comet/issues
- npm.io page: https://npm.io/package/comet-server

## Dependencies (2)

- [express](https://npm.io/package/express.md) ^4.12.3
- [coffee-script](https://npm.io/package/coffee-script.md) ^1.9.2

## Recent versions

- 0.0.4 (latest) — 2015-05-01
- 0.0.3 — 2015-04-26
- 0.0.2 — 2015-04-25
- 0.0.1 — 2015-04-25
- 0.0.0 — 2015-04-25

## README

### A comet server with easy use api

```
  //server (with express 4.x)
  var Comet = require("./lib/comet");
  var comet = new Comet(['test']);
  
  router.use('/comet', comet.getMiddleWare());
  
  setInterval(function(){
    comet.pushData('test', Date.now());
  }, 1000);
```

```
  //client (with jQuery)
  
  var path = '/comet/test';
  
  function request () {
  
    $.get(path, function(result) {
      var i;
      path = result.newPath;
      if (result.datas) {
        for (i = 0; i < result.datas.length; i++) {
          if (result.datas[i].type === "test") {
           console.log(new Date(result.datas[i].data));
          }
        }
      }
      request ()
    });
  
  }
  request ()
```

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