Skip to content

Commit 4234940

Browse files
use node-fetch in usa state capitals TS notebook example (#124)
1 parent f77dc6d commit 4234940

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

notebooks/usa-state-capitals-ts.nnb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{
1111
"language": "typescript",
1212
"source": [
13-
"import fs from 'fs';\r\nconst geoJson = fs.readFileSync('../data/usa-state-capitals.geojson', 'utf-8');\r\nconst { display } = require('node-kernel');\r\ndisplay.text(geoJson);"
13+
"import * as fetch from 'node-fetch';\r\nconst dataUrl = 'https://raw.githubusercontent.com/RandomFractals/vscode-data-table/main/data/usa-state-capitals.geojson';\r\nconst geoJson = await fetch(dataUrl).then(res => res.text());\r\nconst { display } = require('node-kernel');\r\ndisplay.text(geoJson);"
1414
],
1515
"outputs": []
1616
}

0 commit comments

Comments
 (0)