-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a3398a0
commit 0da5aa5
Showing
6 changed files
with
66 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
const fs = require('fs'); | ||
|
||
['array', 'string', 'utils'].forEach(subFolder => { | ||
fs.writeFileSync(`./${subFolder}/index.d.ts`, `export * from './${subFolder}'`) | ||
fs.writeFileSync(`./${subFolder}/index.d.ts`, `export * from './${subFolder}'; | ||
export * from './types';`); | ||
fs.copyFileSync('./src/types.ts', `./${subFolder}/types.ts`) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const { dataPipe } = require('datapipe-js'); | ||
const { avg } = require('datapipe-js/array'); | ||
const fetch = require('node-fetch'); | ||
|
||
async function main() { | ||
|
||
const dataUrl = "https://raw.githubusercontent.com/FalconSoft/sample-data/master/CSV/sample-testing-data-100.csv"; | ||
const csv = await (await fetch(dataUrl)).text(); | ||
|
||
return dataPipe() | ||
.fromCsv(csv) | ||
.groupBy(r => r.Country) | ||
.select(g => ({ | ||
country: dataPipe(g).first().Country, | ||
sales: dataPipe(g).sum(i => i.Sales), | ||
avg: avg(g, i => i.Sales), | ||
count: g.length | ||
}) | ||
) | ||
.where(r => r.sales > 5000) | ||
.sort("sales DESC") | ||
.toArray(); | ||
} | ||
|
||
main() | ||
.then(console.log) | ||
.catch(console.error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters