Browse Source

make nodejs package programtaically usable

pull/99/head
Ciro Santilli 1 year ago
parent
commit
2c122f66b5
3 changed files with 13 additions and 5 deletions
  1. +2
    -4
      china-dictatorship
  2. +9
    -0
      index.js
  3. +2
    -1
      package.json

+ 2
- 4
china-dictatorship View File

@ -1,5 +1,3 @@
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const PACKAGE_PATH = path.dirname(require.resolve(path.join('china-dictatorship', 'package.json')));
console.log(fs.readFileSync(path.join(PACKAGE_PATH, 'README.html'), 'utf8'));
const china_dictatorship = require('china-dictatorship');
console.log(china_dictatorship.get_data());

+ 9
- 0
index.js View File

@ -0,0 +1,9 @@
const fs = require('fs');
const path = require('path');
const PACKAGE_PATH = path.dirname(require.resolve(path.join('china-dictatorship', 'package.json')));
const README_PATH = path.join(PACKAGE_PATH, 'README.html');
function get_data() {
return fs.readFileSync(README_PATH, 'utf8');
}
exports.get_data = get_data;

+ 2
- 1
package.json View File

@ -6,6 +6,7 @@
"description": "2018新疆改造中心,1989六四事件,1999法轮功 ,2019 996.ICU, 2018包子露宪,2015 710律师劫,2015巴拿马文件 邓家贵,2017低端人口,2008西藏骚乱",
"devDependencies": {},
"files": [
"index.js",
"china-dictatorship",
"README",
"README.adoc",
@ -21,5 +22,5 @@
"scripts": {
"prepublishOnly": "cp README.adoc README;make"
},
"version": "0.0.52"
"version": "0.0.54"
}

Loading…
Cancel
Save