Node ready#2
Open
synthresin wants to merge 3 commits into
Open
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
npm 패키지로 기능할 수 있도록 Multilingual 객체를 다시 작성합니다.
1. package.json 정리
1-1. npm 권고에 맞게 패키지 이름에
.js제거1-2. 현재 당장 필요 없는
devDependency제거. 정말 npm 상으로 필요할때 넣기.2.
index.js작성하여, 해당 파일을import하여,Multilingual객체 사용할 수 있게 하도록 함.다른 webpack 기반 프로젝트에서 local npm 모듈로 로드하여, 잘 동작함을 확인함.
응용 코드 작성 사례

결과

3. 그외
prototype 자체 정의 대신, prototype 의 각 메소드를 정의하는 방식으로.(이게 사이드 이펙트가 없다나.)
패키지 이름과 맞추기 위해
MultiLingual에서Multilingual로 객체 이름 변경.변수 컨벤션 JS 에 맞게 camelCase 로.
4. 앞으로 해볼 만한 것.
이 npm 패키지를 사용하여 다른 응용 패키지를 만들수 있도록, 기능에서 DOM replace을 빼내기.
(이부분은 좀 이야기가 필요할 수도)
예시 코드 좀더 robust 하게. (이런데선 webpack 이 필요할지도)
npm 못쓰는 사람들에게 코드 제공하는법 찾아보기. (UMD build)