-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.js
25 lines (22 loc) · 817 Bytes
/
build.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'use strict';
var fs = require('fs');
var labels = require('./index.js').labels;
var readme = fs.readFileSync(__dirname + '/README.md', 'utf8');
readme = readme.replace(/\#\#\ Supported\ Encodings[^\#]+/gm, '## Supported Encodings\n\n' +
labels.map(function (encoding) {
return ' - ' + encoding;
}).join('\n') +
'\n\n');
fs.writeFileSync(__dirname + '/README.md', readme);
var keywords = [
"codec",
"decoder",
"decoding",
"encoder",
"encoding",
"legacy",
"legacy-encoding"
].concat(labels).concat(['browserify']);
var pkg = JSON.parse(fs.readFileSync(__dirname + '/package.json', 'utf8'));
pkg.keywords = keywords;
fs.writeFileSync(__dirname + '/package.json', JSON.stringify(pkg, null, ' ') + '\n');