# 4front-s3-deployments

> S3 based deployments for 4front

Latest version **0.0.1** (published 2015-04-17) · 0 weekly downloads

## Install

```sh
npm install 4front-s3-deployments
pnpm add 4front-s3-deployments
yarn add 4front-s3-deployments
bun add 4front-s3-deployments
```

## 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.1 |
| Published | 2015-04-17 |
| First published | 2015-04-17 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+6 in 2 direct dependencies) |
| Install scripts | no |
| Author | David Von Lehman |
| Maintainers | dvonlehman |

## Links

- npm: https://www.npmjs.com/package/4front-s3-deployments
- npm.io page: https://npm.io/package/4front-s3-deployments

## Dependencies (7)

- [mime](https://npm.io/package/mime.md) ^1.3.4
- [async](https://npm.io/package/async.md) ^0.9.0
- [debug](https://npm.io/package/debug.md) ^2.1.3
- [lodash](https://npm.io/package/lodash.md) ^3.6.0
- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.1.19
- [dash-assert](https://npm.io/package/dash-assert.md) ^1.0.1
- [simple-errors](https://npm.io/package/simple-errors.md) ^1.0.1

## Recent versions

- 0.0.1 (latest) — 2015-04-17

## README

# 4front-s3-deployments

<!-- [![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url] -->
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]

[S3](http://aws.amazon.com/s3) based code deployments or the [4front web platform](http://4front.io). Used to store uploaded virtual app assets such as JavaScripts, stylesheets, html files, images, and more.

Although static assets can be served via the 4front node.js platform, it is more efficient to use S3 as a web host directly. See the AWS docs on how to [configure a bucket for static hosting](http://docs.aws.amazon.com/AmazonS3/latest/UG/ConfiguringBucketWebsite.html). As a further optimization you can configure CloudFront (or another CDN) in front of the S3 bucket URL. The [htmlprep](https://www.npmjs.com/package/htmlprep) package dynamically rewrites your relative asset paths to the appropriate absolute path.

For a local installation of the 4front platform, the [s3rver](https://www.npmjs.com/package/s3rver) provides a mock implementation of S3 that utilizes your local filesystem.

## Installation
~~~
npm install 4front-s3-deployments
~~~

## Usage

~~~js
var s3Deployments = require('4front-s3-deployments')({
	region: 'us-west-2',
	bucket: '4front-deployments'
});
~~~

You can pass in any valid option accepted by the [AWS.config](http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html) object including `region`, `accessKeyId`, `secretAccessKey`, etc.

### API

~~~js
// Deploy an individual file
s3Deployments.deployFile(appId, versionId, fileInfo, callback);

// Returns a readable stream
s3Deployments.readFileStream(appId, versionId, filePath);

// Delete version
s3Deployments.deleteVersion(appId, versionId, callback);

// Delete all deployed versions for an app
s3Deployments.deleteAllVersions(appId, callback);

// List all the files for a version
s3Deployments.listFiles(appId, versionId, callback);

// Check if file exists
s3Deployments.fileExists(appId, versionId, filePath, callback);
~~~

See the [unit tests](https://github.com/4front/s3-deployments/blob/master/test/s3.js) for example calls of all these functions.

## Running Tests
~~~
npm test
~~~

## License
Licensed under the Apache License, Version 2.0. See the top-level file LICENSE.txt and (http://www.apache.org/licenses/LICENSE-2.0).

[npm-image]: https://img.shields.io/npm/v/4front-s3-deployments.svg?style=flat
[npm-url]: https://npmjs.org/package/4front-s3-deployments
[travis-image]: https://img.shields.io/travis/4front/s3-deployments.svg?style=flat
[travis-url]: https://travis-ci.org/4front/s3-deployments
[coveralls-image]: https://img.shields.io/coveralls/4front/s3-deployments.svg?style=flat
[coveralls-url]: https://coveralls.io/r/4front/s3-deployments?branch=master
[downloads-image]: https://img.shields.io/npm/dm/4front-s3-deployments.svg?style=flat
[downloads-url]: https://npmjs.org/package/4front-s3-deployments

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