Skip to content

Commit

Permalink
Add back main. Data-search does not import cli.js to write to file.
Browse files Browse the repository at this point in the history
  • Loading branch information
jvwong committed Mar 9, 2023
1 parent 6fcc22e commit 0227a97
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ async function formatData (dataArray) {
}
}

async function main () { // eslint-disable-line no-unused-vars
async function main () {
(program
.name('hyper-recent')
.description('A CLI to do hyper-recent feed analysis')
Expand Down Expand Up @@ -150,3 +150,5 @@ async function main () { // eslint-disable-line no-unused-vars

await program.parseAsync();
}

main();
5 changes: 4 additions & 1 deletion src/data-search.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
#! /usr/bin/env node
import _ from 'lodash';
import fs from 'fs';
import { writeFile } from 'fs/promises';
import { format, sub } from 'date-fns';
import { download } from './download.js';
import { Search } from './search.js';
import { writeFormattedJSON } from './cli.js';

/**
* Download preprint data from BiorXiv and MedrXiv servers and perform search for preprints in each topic.
* @returns {collection}, a JSON array of search results for each set topic.
*/
export async function getData () {
const formatJSON = obj => JSON.stringify(obj, null, 2);
const writeFormattedJSON = async (obj, file) => await writeFile(file, formatJSON(obj));

// Set dates for past month
const now = new Date();
const startOffset = { months: 1 };
Expand Down

0 comments on commit 0227a97

Please sign in to comment.