node package manager

gulp-convert-encoding

gulp-convert-encoding

Build Status Coverage Status Dependency Status NPM Downloads

Convert files from one encoding to another using iconv-lite.

Install

$ npm install --save-dev gulp-convert-encoding

Usage

var gulp = require('gulp');
var convertEncoding = require('gulp-convert-encoding');
 
gulp.task('default', function () {
    return gulp.src('src/file.txt')
        .pipe(convertEncoding({to: 'iso-8859-15'}))
        .pipe(gulp.dest('dist'));
});

API

convertEncoding(options)

options

One or both of the original and/or target file encodings must be specified.

Supported encodings are listed on the iconv-lite wiki.

from

Type: string
Default: utf8

The original file encoding.

to

Type: string
Default: utf8

The target file encoding.

iconv

Type: object Default: {decode: {}, encode: {}}

Allows you to pass additional options into iconv-lite. For example BOM Handling.

License

MIT © Alice Rose