File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # AZ-generator
1+ # AZ-generator
2+
3+ ## How to install?
4+ First, install the package from npm.<br >
5+ We are managing two packages, ` az-gen ` and ` az-generator ` .
6+ ``` shell
7+ npm install az-generator
8+ npm install az-gen
9+ ```
10+
11+ ## How to use?
12+ ``` js
13+ import { AzGagGenerator } from " az-generator" ;
14+
15+ const gag = AzGagGenerator ();
16+ console .log (gag); // ["F가 애매한 이유는", "F=ma니까"]
17+ ```
18+
19+ ## How to Contribute?
20+ Fork -> Clone -> Change -> Commit -> Push -> PR
21+
22+
23+ ## package names
24+
25+ | package names |
26+ | :--:|
27+ | az-gen |
28+ | az-generator |
29+
30+
31+ ## Contributor
32+ | <img src =" https://avatars.githubusercontent.com/u/35485904 " >| <img src =" https://avatars.githubusercontent.com/u/62806979 " >| <img src =" https://avatars.githubusercontent.com/u/33440010 " >| <img src =" https://avatars.githubusercontent.com/u/12760587 " >|
33+ | :-:| :-:| :-:| :-:|
34+ | [ Kwanho Kim] ( https://github.com/KKWANH ) | [ Yeonseong-Lee] ( https://github.com/YeonSeong-Lee ) | [ Minjae kim] ( https://github.com/minjae9610 ) | [ Juyeong Maing] ( https://github.com/mjy9088 ) |
Original file line number Diff line number Diff line change 1- import readline from 'readline'
2- import getGag from './lib.js'
1+ const readline = require ( 'readline' ) ;
2+ const getGag = require ( './lib.js' ) ;
33
44const rl = readline . createInterface ( {
55 input : process . stdin ,
Original file line number Diff line number Diff line change 1- import { readFileSync } from "fs" ;
2- import assert from "assert" ;
1+ const { readFileSync } = require ( "fs" ) ;
2+ const { resolve } = require ( "path" ) ;
3+ const assert = require ( "assert" ) ;
34
45/**
56 * @type {[a: string, answer: string][] }
67 */
78const dataset = ( ( ) => {
8- const question = readFileSync ( "./ AZ-GAG-dataset/question.csv") . toString ( ) . split ( "\n" ) . filter ( ( line ) => line ) ;
9- const answer = readFileSync ( "./ AZ-GAG-dataset/answer.csv") . toString ( ) . split ( "\n" ) . filter ( ( line ) => line ) ;
9+ const question = readFileSync ( resolve ( __dirname , " AZ-GAG-dataset/question.csv") ) . toString ( ) . split ( "\n" ) . filter ( ( line ) => line ) ;
10+ const answer = readFileSync ( resolve ( __dirname , " AZ-GAG-dataset/answer.csv") ) . toString ( ) . split ( "\n" ) . filter ( ( line ) => line ) ;
1011 assert ( question . length === answer . length ) ;
1112 return question . map ( ( _ , i ) => [ question [ i ] , answer [ i ] ] ) ;
1213} ) ( ) ;
1314
1415/**
1516 * @returns {[question: string, answer: string] } random AZGag
1617 */
17- export default function AZGagGenerator ( ) {
18+ module . exports = function AZGagGenerator ( ) {
1819 return dataset [ Math . floor ( Math . random ( ) * dataset . length ) ] ;
1920} ;
Original file line number Diff line number Diff line change 11{
2+ "private" : true ,
23 "name" : " az-generator" ,
34 "organizations" : " AZ-GAG" ,
4- "version" : " 0 .0.0 " ,
5+ "version" : " 1 .0.3 " ,
56 "description" : " generates az-gag" ,
6- "main" : " index.js" ,
7- "type" : " module" ,
7+ "main" : " lib.js" ,
88 "scripts" : {
9- "test" : " echo \" Error: no test specified\" && exit 1"
9+ "test" : " echo \" Error: no tes specified\" && exit 1"
1010 },
1111 "repository" : {
1212 "type" : " git" ,
2121 "contributors" : [
2222 " Kwanho Kim <kwanho0096@gmail.com> (https://github.com/KKWANH)" ,
2323 " YeonSeong-Lee <yeonseong.dev@gmail.com> (https://github.com/YeonSeong-Lee)" ,
24- " Minjae Kim <hjn966@naver .com> (https://github.com/minjae9610)" ,
24+ " Minjae Kim <mjkim961001@gmail .com> (https://github.com/minjae9610)" ,
2525 " Juyeong Maing <mjy9088@naver.com> (https://github.com/mjy9088)"
2626 ],
2727 "license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments