-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
3 changed files
with
84 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
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 |
---|---|---|
|
@@ -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 <[email protected]>", | ||
"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": "[email protected]" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.