# github2cocoon

> Express.js middleware to use a github repository/branch as a zip file endpoint for the CocoonJS Launcher.

Latest version **0.1.2** (published 2014-04-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install github2cocoon
pnpm add github2cocoon
yarn add github2cocoon
bun add github2cocoon
```

## 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.1.2 |
| Published | 2014-04-29 |
| First published | 2014-04-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Andy Perlitch |
| Maintainers | andyperlitch |
| Keywords | cocoonjs, github, archive, zip, ludei, launcher |

## Links

- npm: https://www.npmjs.com/package/github2cocoon
- Repository: https://github.com/andyperlitch/node-github2cocoon
- Issues: https://github.com/andyperlitch/node-github2cocoon/issues
- npm.io page: https://npm.io/package/github2cocoon

## Dependencies (3)

- [unzip](https://npm.io/package/unzip.md) ^0.1.9
- [request](https://npm.io/package/request.md) ^2.34.0
- [archiver](https://npm.io/package/archiver.md) ^0.9.0

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 0.1.2 (latest) — 2014-04-29
- 0.1.1 — 2014-04-27
- 0.1.0 — 2014-04-27
- 0.0.0 — 2014-04-27

## README

github2cocoon
=============
Express.js middleware to use a github repository/branch as a zip file endpoint for the [CocoonJS Launcher](http://support.ludei.com/hc/en-us/articles/201048463-How-to-use).

install
-------
```
npm install --save github2cocoon
```

usage
-----

### with predefined username
This is the simplest use-case: when you only want to get zip archives from a single github user account (your own).
```JavaScript
var express = require('express');
var app = express();
var github2cocoon = require("github2cocoon");

app.use(github2cocoon("zips", { username: "andyperlitch" }));
app.listen(80);
```

Then, put your server's endpoint url into the Launcher:
![CocoonJS Launcher screenshot](/screenshot.png)

Notice how the URL is `http://yourserver.com/[ROOT_DIR]/[REPO_URL]/[BRANCH_NAME].zip`.

### without a predefined username
Simply leave out the `username` option and the endpoints will be in the format: `http://yourserver.com/[ROOT_DIR]/[USERNAME]/[REPO_URL]/[BRANCH_NAME].zip`


motivation
----------
Ludei's CocoonJS Launcher allows you to specify a URL endpoint for a zip containing your app. I wanted to use Github's archive endpoints (e.g. https://github.com/[USERNAME]/[REPO]/archive/[BRANCH].zip) for this purpose so that I could push to GH and then immediately test on my phone. This turns out not to work because Github packages the zip archive in a way that cocoon cannot find and execute the proper files. This middleware transforms the zip archive in a cocoon-compatible way.

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