diff --git a/README.md b/README.md new file mode 100644 index 0000000..61aa0ba --- /dev/null +++ b/README.md @@ -0,0 +1,55 @@ +# neis.ts + +![License](https://img.shields.io/github/license/star0202/neis.ts?style=flat-square) + +NEIS Open API를 쉽게 사용하기 위한 TypeScript API Wrapper입니다. + +## Installation + +```bash +npm install neis.ts +# or +yarn add neis.ts +# or +pnpm add neis.ts +``` + +## Optional Dependencies + +- [tslog](https://www.npmjs.com/package/tslog) (로깅) + +## Usage + +```ts +import { Neis } from 'neis.ts'; +import { Logger } from 'tslog'; // Optional + +const logger = new Logger() // Optional +const neis = new Neis({ + // NeisConfig 참고 + KEY: 'API KEY', + Type: 'json', + pIndex: 1, + pSize: 100, + logger: logger, // Optional +}) + +;(async () => { + const school = await neis.getSchoolOne({ + // SchoolRequestParams 참고 + ATPT_OFCDC_SC_CODE: '시도교육청코드', + SD_SCHUL_CODE: '표준학교코드', + }) + const meal = await school.getMealOne({ + // MealRequestParams 참고 + MLSV_YMD: 'yyyymmdd', + }) + + console.log(school) + console.log(meal) +})() +``` + +## Official API Docs by NEIS + +- [교육정보 공공데이터포털](https://www.data.go.kr/data/15012690/openapi.do) diff --git a/package.json b/package.json index eabd8f3..6703378 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,9 @@ "type": "git", "url": "https://github.com/star0202/neis.ts" }, - "author": "Starcea", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "author": "Starcea ", "license": "MIT", "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.1.1", @@ -20,15 +22,26 @@ "jest": "^29.5.0", "prettier": "^2.8.7", "ts-jest": "^29.0.5", - "ts-node": "^10.9.1" - }, - "scripts":{ - "lint": "eslint src --ignore-path .gitignore", - "test": "jest" + "ts-node": "^10.9.1", + "typescript": "^5.0.3" }, "dependencies": { - "axios": "^1.3.4", + "axios": "^1.3.4" + }, + "optionalDependencies": { "tslog": "^4.8.2" }, + "keywords": [ + "neis", + "api", + "wrapper", + "typescript", + "korean" + ], + "scripts": { + "lint": "eslint src --ignore-path .gitignore", + "test": "jest", + "build": "tsc" + }, "packageManager": "pnpm@7.30.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 806b9b1..26cbdaa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,6 +4,8 @@ dependencies: axios: specifier: ^1.3.4 version: 1.3.4 + +optionalDependencies: tslog: specifier: ^4.8.2 version: 4.8.2 @@ -41,10 +43,13 @@ devDependencies: version: 2.8.7 ts-jest: specifier: ^29.0.5 - version: 29.0.5(@babel/core@7.21.3)(jest@29.5.0)(typescript@5.0.3) + version: 29.0.5(jest@29.5.0)(typescript@5.0.3) ts-node: specifier: ^10.9.1 version: 10.9.1(@types/node@18.15.11)(typescript@5.0.3) + typescript: + specifier: ^5.0.3 + version: 5.0.3 packages: @@ -3016,7 +3021,7 @@ packages: is-number: 7.0.0 dev: true - /ts-jest@29.0.5(@babel/core@7.21.3)(jest@29.5.0)(typescript@5.0.3): + /ts-jest@29.0.5(jest@29.5.0)(typescript@5.0.3): resolution: {integrity: sha512-PL3UciSgIpQ7f6XjVOmbi96vmDHUqAyqDr8YxzopDqX3kfgYtX1cuNeBjP+L9sFXi6nzsGGA6R3fP3DDDJyrxA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -3037,7 +3042,6 @@ packages: esbuild: optional: true dependencies: - '@babel/core': 7.21.3 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 jest: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) @@ -3088,7 +3092,9 @@ packages: /tslog@4.8.2: resolution: {integrity: sha512-eAKIRjxfSKYLs06r1wT7oou6Uv9VN6NW9g0JPidBlqQwPBBl5+84dm7r8zSOPVq1kyfEw1P6B3/FLSpZCorAgA==} engines: {node: '>=16'} + requiresBuild: true dev: false + optional: true /tsutils@3.21.0(typescript@5.0.3): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==}