Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

store choices in json format #181

Open
milahu opened this issue Feb 18, 2021 · 0 comments
Open

store choices in json format #181

milahu opened this issue Feb 18, 2021 · 0 comments

Comments

@milahu
Copy link

milahu commented Feb 18, 2021

to make the data files usable from commonJS and ES6

cd @alheimsins/b5-johnson-120-ipip-neo-pi-r
find ./data -name choices.js | while read i
do
  o=${i}on
  node -e "console.log(JSON.stringify(require('$i'), null, 2))" >$o
  git rm $i
  git add $o
  echo converted $i to $o
done
git commit -m 'store choices in json format'

sample use:

const choices = await (await fetch(`/data/${lang}/choices.json`)).json();

import() only works with *.js files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant