# @swim/app

> Lightweight application loader that dynamically instantiates views and controllers declared by HTML attributes

Latest version **3.10.1** (published 2019-08-19) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @swim/app
pnpm add @swim/app
yarn add @swim/app
bun add @swim/app
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.10.1 |
| Published | 2019-08-19 |
| First published | 2018-01-31 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 24 |
| Unpacked size | 74.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Chris Sachs |
| Maintainers | c9r, ctrinh, scottswim, swim-iot |

## Links

- npm: https://www.npmjs.com/package/@swim/app
- Repository: https://github.com/swimos/swim
- Issues: https://github.com/swimos/swim/issues
- npm.io page: https://npm.io/package/@swim/app

## Dependencies (24)

- [@swim/dom](https://npm.io/package/@swim/dom.md) 3.10.1
- [@swim/uri](https://npm.io/package/@swim/uri.md) 3.10.1
- [@swim/font](https://npm.io/package/@swim/font.md) 3.10.1
- [@swim/math](https://npm.io/package/@swim/math.md) 3.10.1
- [@swim/time](https://npm.io/package/@swim/time.md) 3.10.1
- [@swim/util](https://npm.io/package/@swim/util.md) 3.10.1
- [@swim/view](https://npm.io/package/@swim/view.md) 3.10.1
- [@swim/angle](https://npm.io/package/@swim/angle.md) 3.10.1
- [@swim/codec](https://npm.io/package/@swim/codec.md) 3.10.1
- [@swim/color](https://npm.io/package/@swim/color.md) 3.10.1
- [@swim/scale](https://npm.io/package/@swim/scale.md) 3.10.1
- [@swim/shape](https://npm.io/package/@swim/shape.md) 3.10.1
- [@swim/style](https://npm.io/package/@swim/style.md) 3.10.1
- [@swim/length](https://npm.io/package/@swim/length.md) 3.10.1
- [@swim/render](https://npm.io/package/@swim/render.md) 3.10.1
- [@swim/animate](https://npm.io/package/@swim/animate.md) 3.10.1
- [@swim/typeset](https://npm.io/package/@swim/typeset.md) 3.10.1
- [@swim/streamlet](https://npm.io/package/@swim/streamlet.md) 3.10.1
- [@swim/structure](https://npm.io/package/@swim/structure.md) 3.10.1
- [@swim/transform](https://npm.io/package/@swim/transform.md) 3.10.1
- [@swim/constraint](https://npm.io/package/@swim/constraint.md) 3.10.1
- [@swim/transition](https://npm.io/package/@swim/transition.md) 3.10.1
- [@swim/collections](https://npm.io/package/@swim/collections.md) 3.10.1
- [@swim/interpolate](https://npm.io/package/@swim/interpolate.md) 3.10.1

## Recent versions

- 3.10.1 (latest) — 2019-08-19
- 3.11.0-dev.20200619 (dev) — 2020-06-19
- 3.11.0-dev.20200517 — 2020-05-17
- 3.10.0 — 2019-07-22
- 3.9.0 — 2019-02-18
- 0.3.1 — 2018-01-31

## README

# @swim/app

[![package](https://img.shields.io/npm/v/@swim/app.svg)](https://www.npmjs.com/package/@swim/app)
[![documentation](https://img.shields.io/badge/doc-TypeDoc-blue.svg)](https://docs.swimos.org/js/latest/modules/_swim_app.html)
[![chat](https://img.shields.io/badge/chat-Gitter-green.svg)](https://gitter.im/swimos/community)

<a href="https://www.swimos.org"><img src="https://docs.swimos.org/readme/marlin-blue.svg" align="left"></a>

**@swim/app** implements a lightweight application loader that dynamically
instantiates views and controllers declared by `swim-` HTML attributes.
**@swim/app** is part of the
[**@swim/web**](https://github.com/swimos/swim/tree/master/swim-system-js/swim-web-js/@swim/web) framework.

## Installation

### npm

For an npm-managed project, `npm install @swim/app` to make it a dependency.
TypeScript sources will be installed into `node_modules/@swim/app/main`.
Transpiled JavaScript and TypeScript definition files install into
`node_modules/@swim/app/lib/main`.  And a pre-built UMD script can
be found in `node_modules/@swim/app/dist/main/swim-app.js`.

### Browser

Browser applications can load `swim-web.js`—which bundles the **@swim/app**
library—along with its `swim-core.js` and `swim-ui.js` dependencies, directly
from the swimOS CDN.

```html
<!-- Development -->
<script src="https://cdn.swimos.org/js/latest/swim-core.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-ui.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-web.js"></script>

<!-- Production -->
<script src="https://cdn.swimos.org/js/latest/swim-core.min.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-ui.min.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-web.min.js"></script>
```

Alternatively, the standalone `swim-system.js` script may be loaded
from the swimOS CDN, which bundles **@swim/app** together with all other
[**@swim/system**](https://github.com/swimos/swim/tree/master/swim-system-js/@swim/system)
libraries.

```html
<!-- Development -->
<script src="https://cdn.swimos.org/js/latest/swim-system.js"></script>

<!-- Production -->
<script src="https://cdn.swimos.org/js/latest/swim-system.min.js"></script>
```

## Usage

### ES6/TypeScript

**@swim/app** can be imported as an ES6 module from TypeScript and other
ES6-compatible environments.

```typescript
import * as app from "@swim/app";
```

### CommonJS/Node.js

**@swim/app** can also be used as a CommonJS module in Node.js applications.

```javascript
var app = require("@swim/app");
```

### Browser

When loaded by a web browser, the `swim-web.js` script adds all
**@swim/app** library exports to the global `swim` namespace.
The `swim-web.js` script requires that `swim-core.js` and `swim-ui.js`
have already been loaded.

The `swim-system.js` script also adds all **@swim/app** library exports
to the global `swim` namespace, making it a drop-in replacement for
'swim-core.js', `swim-ui.js`, and `swim-web.js` when additional
**@swim/system** libraries are needed.

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