Skip to content

Commit

Permalink
Use ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Mar 9, 2021
1 parent c994561 commit 3a7ed48
Show file tree
Hide file tree
Showing 8 changed files with 426 additions and 424 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.DS_Store
*.log
coverage/
node_modules/
meta-name.js
meta-name.min.js
yarn.lock
4 changes: 1 addition & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
meta-name.js
meta-name.min.js
*.json
coverage/
*.md
30 changes: 16 additions & 14 deletions build.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
'use strict'

var fs = require('fs')
var https = require('https')
var bail = require('bail')
var concat = require('concat-stream')
var unified = require('unified')
var parse = require('rehype-parse')
var q = require('hast-util-select')
var toString = require('hast-util-to-string')
var list = require('.')
import fs from 'fs'
import https from 'https'
import bail from 'bail'
import concat from 'concat-stream'
import unified from 'unified'
import parse from 'rehype-parse'
import q from 'hast-util-select'
import toString from 'hast-util-to-string'
import {metaName} from './index.js'

var proc = unified().use(parse)

Expand All @@ -27,10 +25,14 @@ function onconcat(buf) {
while (++index < cells.length) {
data = toString(cells[index]).trim().toLowerCase()

if (data && !list.includes(data)) {
list.push(data)
if (data && !metaName.includes(data)) {
metaName.push(data)
}
}

fs.writeFile('index.json', JSON.stringify(list.sort(), 0, 2) + '\n', bail)
fs.writeFile(
'index.js',
'export var metaName = ' + JSON.stringify(metaName.sort(), null, 2) + '\n',
bail
)
}
Loading

0 comments on commit 3a7ed48

Please sign in to comment.