0.0.5 • Published 8 years ago

koafs v0.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

Koa.fs

Send files using Koa2.
Made using GNU Nano 2.8.5. :-)

How to install

You can install the koafs through:

A) npm, using npm install koafs --save
B) yarn, using yarn add koafs --save

How to use

// Retrieves the module
const koafs = require("koafs");

// Create a simple function to handle a route
const handle = (ctx) => {

    // Send the file to the client-side, A.K.A download.
    koafs(ctx, {
        "name": 'how-to-use.txt',
        "path": __dirname + '/README.md',
        "mimetype": 'text/markdown'
    });

};

/**
 * Let's create the koa2 route.
 * PS: this model of route definition is from koa-better-router,
 *    I use and recommend it for you use too.
 */
router.get("/download", handle);

Found a bug?

Feel free to create a issue on this repository.

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago