File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ async function formatData (dataArray) {
120120 }
121121}
122122
123- async function main ( ) { // eslint-disable-line no-unused-vars
123+ async function main ( ) {
124124 ( program
125125 . name ( 'hyper-recent' )
126126 . description ( 'A CLI to do hyper-recent feed analysis' )
@@ -150,3 +150,5 @@ async function main () { // eslint-disable-line no-unused-vars
150150
151151 await program . parseAsync ( ) ;
152152}
153+
154+ main ( ) ;
Original file line number Diff line number Diff line change 11#! /usr/bin/env node
22import _ from 'lodash' ;
33import fs from 'fs' ;
4+ import { writeFile } from 'fs/promises' ;
45import { format , sub } from 'date-fns' ;
56import { download } from './download.js' ;
67import { Search } from './search.js' ;
7- import { writeFormattedJSON } from './cli.js' ;
88
99/**
1010 * Download preprint data from BiorXiv and MedrXiv servers and perform search for preprints in each topic.
1111 * @returns {collection }, a JSON array of search results for each set topic.
1212 */
1313export async function getData ( ) {
14+ const formatJSON = obj => JSON . stringify ( obj , null , 2 ) ;
15+ const writeFormattedJSON = async ( obj , file ) => await writeFile ( file , formatJSON ( obj ) ) ;
16+
1417 // Set dates for past month
1518 const now = new Date ( ) ;
1619 const startOffset = { months : 1 } ;
You can’t perform that action at this time.
0 commit comments