Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix readme

  • Loading branch information...
commit eaab8ed1038a78982ccd9a91c9e09736178798da 1 parent fb789a9
Andriy Bazyuta authored

Showing 2 changed files with 102 additions and 7 deletions. Show diff stats Hide diff stats

  1. +6 7 README.md
  2. +96 0 output.html
13 README.md
Source Rendered
@@ -36,14 +36,15 @@ Example:
36 36 }
37 37
38 38 2. **Now you can use Alleup**
  39 +
  40 + ```javascript
  41 + var Alleup = require('alleup');
  42 + var alleup = new Alleup({storage : "aws", config_file: "path_to_alleup_config.json"})
39 43
40   - ```javascript
41   - var Alleup = require('alleup');
42   - var alleup = new Alleup({storage : "aws", config_file: "path_to_alleup_config.json"})
  44 + You can use `storage: 'aws'` for store files on Amazon S3 or `storage: 'dir'` for store files in filesystem
43 45
44   -You can use `storage: 'aws'` for store files on Amazon S3 or `storage: 'dir'` for store files in filesystem
  46 +3. **Upload example:**
45 47
46   - **Upload example**
47 48
48 49 ```javascript
49 50 app.post('/upload', function(req, res) {
@@ -55,8 +56,6 @@ You can use `storage: 'aws'` for store files on Amazon S3 or `storage: 'dir'` fo
55 56 });
56 57 });
57 58
58   -
59   -
60 59 ### Contribution
61 60 **Pull requests are welcome!!!**
62 61
96 output.html
... ... @@ -0,0 +1,96 @@
  1 +<h1 id="alleup">Alleup</h1>
  2 +
  3 +<p>Flexible way to resize and upload images to Amazon S3 or file system storages for Node.js. Possible to add different versions of the same file in cropped or resized variant.</p>
  4 +
  5 +<h2 id="installation">Installation</h2>
  6 +
  7 +<pre><code>$ npm install alleup
  8 +</code></pre>
  9 +
  10 +<h2 id="quickstart">Quick Start</h2>
  11 +
  12 +<ol>
  13 +<li><p><strong>You need to create alleup configuration file with image variants and your storages</strong>
  14 +Example:</p>
  15 +
  16 +<p>&#8220;`javascript
  17 +{
  18 + &#8220;variants&#8221;: {
  19 + &#8220;resize&#8221;: {
  20 + &#8220;mini&#8221; : &#8220;300x200&#8221;,
  21 + &#8220;preview&#8221;: &#8220;800x600&#8221;
  22 + },
  23 + &#8220;crop&#8221;: {
  24 + &#8220;thumb&#8221;: &#8220;200x200&#8221;
  25 + }
  26 + },</p>
  27 +
  28 +<pre><code>"storage": {
  29 + "aws": {
  30 + "key" : "AWS_KEY",
  31 + "secret" : "AWS_SECRET",
  32 + "bucket" : "AWS_BUCKET"
  33 + },
  34 + "dir": {
  35 + "path" : "./public/images/"
  36 + }
  37 +}
  38 +</code></pre>
  39 +
  40 +<p>}</p></li>
  41 +<li><p><strong>Now you can use Alleup</strong></p>
  42 +
  43 +<p>&#8220;`javascript
  44 + var Alleup = require(&#8216;alleup&#8217;);
  45 + var alleup = new Alleup({storage : &#8220;aws&#8221;, config_file: &#8220;path_to_alleup_config.json&#8221;})</p></li>
  46 +</ol>
  47 +
  48 +<p>You can use <code>storage: 'aws'</code> for store files on Amazon S3 or <code>storage: 'dir'</code> for store files in filesystem</p>
  49 +
  50 +<p><strong>Upload example:</strong></p>
  51 +
  52 +<pre><code>```javascript
  53 +app.post('/upload', function(req, res) {
  54 + alleup.upload(req, res, function(err, file, res){
  55 +
  56 + console.log("FILE UPLOADED: " + file);
  57 + // THIS YOU CAN SAVE FILE TO DATABASE FOR EXAMPLE
  58 + res.end();
  59 + });
  60 +});
  61 +</code></pre>
  62 +
  63 +<h3 id="contribution">Contribution</h3>
  64 +
  65 +<p><strong>Pull requests are welcome!!!</strong></p>
  66 +
  67 +<h3 id="license">License</h3>
  68 +
  69 +<p>(The MIT License)</p>
  70 +
  71 +<p>Copyright (c) 2011 Andriy Bazyuta &lt;andriy.bazyuta@gmail.com&gt;</p>
  72 +
  73 +<p>Permission is hereby granted, free of charge, to any person obtaining
  74 +a copy of this software and associated documentation files (the
  75 +&#8216;Software&#8217;), to deal in the Software without restriction, including
  76 +without limitation the rights to use, copy, modify, merge, publish,
  77 +distribute, sublicense, and/or sell copies of the Software, and to
  78 +permit persons to whom the Software is furnished to do so, subject to
  79 +the following conditions:</p>
  80 +
  81 +<p>The above copyright notice and this permission notice shall be
  82 +included in all copies or substantial portions of the Software.</p>
  83 +
  84 +<p>THE SOFTWARE IS PROVIDED &#8216;AS IS&#8217;, WITHOUT WARRANTY OF ANY KIND,
  85 +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  86 +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  87 +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  88 +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  89 +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  90 +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
  91 +
  92 +<hr />
  93 +
  94 +<h3 id="author">Author</h3>
  95 +
  96 +<p>Andriy Bazyuta</p>

0 comments on commit eaab8ed

Please sign in to comment.
Something went wrong with that request. Please try again.