Skip to content

Commit

Permalink
Use ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Apr 6, 2021
1 parent db49f72 commit 660377f
Show file tree
Hide file tree
Showing 8 changed files with 1,511 additions and 1,508 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
.DS_Store
*.log
coverage/
data/
node_modules/
archive.zip
afinn-96.js
afinn-96.min.js
yarn.lock
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
coverage/
afinn-96.js
afinn-96.min.js
*.md
22 changes: 12 additions & 10 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
'use strict'

var fs = require('fs')
var path = require('path')
var https = require('https')
var yauzl = require('yauzl')
var dsv = require('d3-dsv')
var concat = require('concat-stream')
var bail = require('bail')
import fs from 'fs'
import path from 'path'
import https from 'https'
import yauzl from 'yauzl'
import dsv from 'd3-dsv'
import concat from 'concat-stream'
import {bail} from 'bail'

var endpoint = 'https://www2.imm.dtu.dk/pubdb/edoc/imm6010.zip'

Expand Down Expand Up @@ -57,7 +55,11 @@ function onopen(error, archive) {
data[rows[index].key] = Number.parseInt(rows[index].value, 10)
}

fs.writeFile('index.json', JSON.stringify(data, null, 2) + '\n', bail)
fs.writeFile(
'index.js',
'export var afinn96 = ' + JSON.stringify(data, null, 2) + '\n',
bail
)
}

function read() {
Expand Down
Loading

0 comments on commit 660377f

Please sign in to comment.