<commit_before># dest-multer

A node.js multipart form express middleware that allow you to separate uploaded
files or renamed based on each request, filename or the name of form field.

[![build status](https://travis-ci.org/chichunchen/dest-multer.svg)](https://travis-ci.org/chichunchen/dest-multer.svg)

## Requirements
node.js >= 4.0.0

## Example Usage

```js
var uploader = destMulter({
  root: '/var/www/website/public/',
  destination: (req, file) =>
    `/uploads/schools/${req.params.id}/sceneries/${file.fieldname}`,
  fields: [
    { name: 'images' },
    { name: 'thumbnail', maxCount: 1 },
  ],
  filename: (req, file) =>
    Date.now() + file.originalname
});

app.post('/post/:id', uploader, function(req, res, next) {
  // req.files => output files with useful information such as file size
  // req.filesPath => output paths relative to root

  res.send(`<img src="${req.filesPath.thumbnail[0]}">'`);
});<commit_msg>Update README.md Travis CI status image.<commit_after># dest-multer

A node.js multipart form express middleware that allow you to separate uploaded
files or renamed based on each request, filename or the name of form field.

[![Build Status](https://travis-ci.org/Fonger/dest-multer.svg)](https://travis-ci.org/Fonger/dest-multer)

## Requirements
node.js >= 4.0.0

## Example Usage

```js
var uploader = destMulter({
  root: '/var/www/website/public/',
  destination: (req, file) =>
    `/uploads/schools/${req.params.id}/sceneries/${file.fieldname}`,
  fields: [
    { name: 'images' },
    { name: 'thumbnail', maxCount: 1 },
  ],
  filename: (req, file) =>
    Date.now() + file.originalname
});

app.post('/post/:id', uploader, function(req, res, next) {
  // req.files => output files with useful information such as file size
  // req.filesPath => output paths relative to root

  res.send(`<img src="${req.filesPath.thumbnail[0]}">'`);
});
{'fraction_non_alphanumeric': 0.17047265002655337, 'fraction_numerical': 0.0053106744556558685, 'mean_word_length': 3.9448818897637796, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2664542', 'n_tokens_mistral': 647, 'n_tokens_neox': 636, 'n_words': 165}