Move code to subfolders
This commit is contained in:
parent
5f85d3e0cf
commit
429cd927c4
9 changed files with 10 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
|||
import { existsSync } from "fs";
|
||||
|
||||
import { asyncLoadJSON, asyncSaveJSON } from "./utils";
|
||||
import { asyncLoadJSON, asyncSaveJSON } from "../lib";
|
||||
|
||||
interface JSONCard {
|
||||
mcmId: number;
|
0
cmd/cube.ts
Normal file
0
cmd/cube.ts
Normal file
|
@ -1,5 +1,4 @@
|
|||
import CardMarketApi from "./api";
|
||||
import { asyncSaveJSON } from "./utils";
|
||||
import { asyncSaveJSON, CardMarketApi } from "../lib";
|
||||
|
||||
async function run() {
|
||||
if (process.argv.length < 3) {
|
|
@ -1,7 +1,6 @@
|
|||
import { existsSync } from "fs";
|
||||
|
||||
import { Article, MCMDB } from "./types";
|
||||
import { asyncLoadJSON, asyncSaveJSON, leanArticle, leanCard } from "./utils";
|
||||
import { Article, asyncLoadJSON, asyncSaveJSON, leanArticle, leanCard, MCMDB } from "../lib";
|
||||
|
||||
async function run() {
|
||||
if (process.argv.length < 3) {
|
|
@ -5,7 +5,7 @@ import { Article } from "./types";
|
|||
|
||||
const URI = "https://api.cardmarket.com/ws/v2.0/output.json";
|
||||
|
||||
export default class CardMarketApi {
|
||||
export class CardMarketApi {
|
||||
private AppToken: string;
|
||||
private AppSecret: string;
|
||||
private AccessToken: string;
|
3
lib/index.ts
Normal file
3
lib/index.ts
Normal file
|
@ -0,0 +1,3 @@
|
|||
export * from "./api";
|
||||
export * from "./types";
|
||||
export * from "./utils";
|
|
@ -6,9 +6,9 @@
|
|||
"author": "Hamcha <hamcha@crunchy.rocks>",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"fetch": "ts-node fetch.ts",
|
||||
"init-db": "ts-node convert.ts",
|
||||
"find": "ts-node find.ts"
|
||||
"fetch": "ts-node cmd/fetch.ts",
|
||||
"init-db": "ts-node cmd/convert.ts",
|
||||
"find": "ts-node cmd/find.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": "^12.12.11",
|
||||
|
|
Loading…
Reference in a new issue