# capella

> Capella cross browser addon framework.

Latest version **1.2.0** (published 2016-03-14) · MIT license · 0 weekly downloads

## Install

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

Provides the command `capella`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2016-03-14 |
| First published | 2016-01-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Benjamin Wozniak |
| Maintainers | woowoo-san |

## Links

- npm: https://www.npmjs.com/package/capella
- npm.io page: https://npm.io/package/capella

## Dependencies (1)

- [fs-extra](https://npm.io/package/fs-extra.md) >=0.26.2

## Recent versions

- 1.2.0 (latest) — 2016-03-14
- 1.1.8 — 2016-03-08
- 1.1.7 — 2016-03-08
- 1.1.6 — 2016-03-08
- 1.1.5 — 2016-03-08
- 1.1.4 — 2016-03-08
- 1.1.3 — 2016-02-24
- 1.1.2 — 2016-02-24
- 1.1.1 — 2016-02-24
- 1.1.0 — 2016-02-06
- 1.0.3 — 2016-01-31
- 1.0.2 — 2016-01-24
- 1.0.1 — 2016-01-23
- 1.0.0 — 2016-01-23

## README

Capella: a cross-browser extension framework
===============================

_Capella is a work in progress!_

![capella logo](capella.png)

Capella is a cross-browser extension framework. Up to now it supports chrome, opera and firefox.

How it works:
----------------
If you deal with cross-browser extension development, you have to address two main issues:
* Every browser has its own API
* Every browser has its own mechanism to import/include files to your extension


So this is how Capella deals with the issues:

* Capella has a cross-browser API that hides the different browser APIs.
* All browsers have a thing in common: they have a persistent background script and contents script which run in the web pages. Capella has a preprocessor which is able to include files (.html or .js) to scripts. So you can include jquery by writing `INCLUDE(jquery.min.js)` in your content script, and that will copy the content of jquery.min.js to your content script. By using the import mechanism you can use every library you want!


How to install Capella:
--------------------------
1. Install node.js with npm
2. Install google chrome if you want to develop chrome extensions
2. Open command shell
2. Run `npm install -g jpm` to install build tool for firefox addons
3. Run `npm install -g capella` to install capella


Capella project structure:
-----------------------------
    my-extension/
        +-- manifest.json
        +-- data/
            +-- js/
            +-- css/
            +-- html/
            +-- ...
        +-- build/
            +-- my-extension-chrome/
            +-- my-extension-firefox/

In your main directory, there is the chrome-style manifest descriping your extension and
the data folder containing all resources. Run `capella build` in your main directory
to build your extension. The build output is copied to the _build_ directory.


Capella commands:
-----------------------
* `capella init`: create an (nearly) empty but valid example extension
* `capella build {target}`: run this command in the main directory (where manifest.json is situated). Creates extension for target browser (chrome or firefox) or both if target is not specified. The output is saved to directory _build_


Preprocessor commands:
-----------------------------
* `INCLUDE(myscript.js)`: Replaces the include command with the content of the specified files
* `INCLUDE_AS_STRING(myfile.html)`: Includes the content of the file as a string. Example: `var popup = INCLUDE_AS_STRING(mypopup.html);`


Capella API:
--------------
To use the Capella API you have to insert `INCLUDE(capella.js)` to your file javascript file.

_TODO: add API reference_

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