npm 레지스트리에서 특정 패키지에 대한 메타데이터 및 기타 정보를 볼 수 있습니다. 이 명령으로 패키지의 최신 버전, 패키지의 종속성, 작성자 및 라이선스 정보, 기타 세부 정보를 확인할 수 있습니다.
# 이전 버전 리스트를 확인하고 싶을때
npm view cowsay versions
# 각 버전이 게시된 시간을 확인
npm view cowsay time
Footnotes
-
설치된 npm 패키지의 버전을 확인하는 방법에 대한 가이드 ↩
Clear CloudFront Cache with AWS CLI | bobbyhadz
zx 의 $ 는 ${} 로 넣은 값을 알아서 quote 한다 — 따옴표를 직접 넣으면(`"/*"`) 따옴표까지 경로가 된다.1
/**
* CloudFront 배포에 대한 캐시를 무효화하려면 경로와 함께 명령을 실행합니다
*
* @param {object} params
* @param {string} params.distributionId
* @param {string} params.paths
* @returns {CreateInvalidationResult}
*/
function createInvalidation({
distributionId,
paths = '/*'
}) {
const result = $`aws cloudfront create-invalidation --distribution-id ${distributionId} --paths ${paths}`
return result
}
Footnotes
-
Getting Started | google/zx: “Everything passed through
${...}will be automatically escaped and quoted.” ↩
- Check whether user has a Chrome extension installed 특정 확장도구가 설치되어 있는지 판별하는 방법
# 크롬 익스텐션이 설치되는 경로는 다음과 같다
/Users/USERNAME/Library/Application Support/Google/Chrome/Default/Extensions
웹 페이지가 확장 리소스를 읽을 수 있는 건 web_accessible_resources 에 선언된 것뿐이다.1
function isInstalled(extensionId) {
return new Promise((resolve, reject) => {
const img = new Image()
img.src = `chrome-extension://${extensionId}/icon-128.png` // 해당 리소스가 `web_accessible_resources`에 선언되어 있는지 확인이 필요하다.
img.onload = () => {
resolve(true)
}
img.onerror = () => {
reject()
}
})
}
Footnotes
-
Manifest - Web Accessible Resources - Chrome for Developers: “By default no resources are web accessible, as this allows a malicious website to fingerprint extensions that a user has installed…” ↩
axios is a simple HTTP client for the browser and Node.js
- GitHub - softonic/axios-retry: Axios plugin that intercepts failed requests and retries them whenever possible1
- GitHub - kuitos/axios-extensions: 🍱 axios extensions lib, including throttle, cache, retry features etc…3
- cacheAdapterEnhancer
- throttleAdapterEnhancer
- retryAdapterEnhancer
Footnotes
- React + Webpack: ChunkLoadError: Loading chunk X failed. | by Raphaël Léger | Medium
- How to fix ChunkLoadError in your ReactJS application - Codemzy’s Blog
lazy로 import했을 경우 ChunkLoadError가 발생하는데 이럴 경우 어떻게 대응할 수 있는지 정리해둔 글들.
git merge 는 공통 조상이 없는 히스토리를 기본으로 거부한다 — --allow-unrelated-histories 가 그 안전장치를 끈다.1
git remote add {alias} {url}
git fetch {alias}
git merge --allow-unrelated-histories {alias}/{branch}
- [git] 서로 다른 repository 합치기 — Falcon
- How do you merge two Git repositories? - Stack Overflow
- How to merge git repositories preserving git history - JDriven Blog
- Git - git-mv Documentation
- Merging two GitHub repositories without losing commit history - Mozilla Hacks - the Web developer blog
Footnotes
-
Git - git-merge Documentation: “By default, git merge command refuses to merge histories that do not share a common ancestor. This option can be used to override this safety when merging histories of two projects that started their lives independently.” ↩
git log포맷 · 마지막 커밋 해시- 변경 사항 버리기 —
checkout·restore .gitignore가 적용되지 않을 때- 다른 저장소 히스토리 합치기 —
--allow-unrelated-histories - 스택 PR — 서로 의존하는 PR 의 연쇄
- subtree
- submodule
- 이름 변경 추적
Footnotes
-
파일 이름이 변경되거나 새 디렉터리로 이동되었지만 콘텐츠의 절반은 그대로인 경우, 커밋 기록은 이제
git log --follow와 유사하게 파일 이름이 변경되었음을 표시합니다. ↩
// cannot be used as a JSX component
@types/react, @types/react-dom에 대한 참조가 잘못되면서 발생하는 이슈
Footnotes
-
cli를 사용할 경우
CHROMATIC_PROJECT_TOKEN을.env에서 관리하면 된다 ↩
# 아마도 git을 사용하고 있을테니까 `git mv`를 사용해서 변경해주자
find src -type f | grep "\.[jt]s$" | xargs -n1 grep -HE "^[^*\n]*(<\/?[a-zA-Z]*>)[\s\w]*$" | cut -d: -f1 | uniq | awk '{print "git mv "$1" "$1"x"}' | sh