{"id":969,"date":"2019-10-10T19:58:43","date_gmt":"2019-10-10T10:58:43","guid":{"rendered":"https:\/\/took.jp\/?p=969"},"modified":"2020-06-15T15:12:24","modified_gmt":"2020-06-15T06:12:24","slug":"post-969","status":"publish","type":"post","link":"https:\/\/took.jp\/tech-blog\/post-969\/","title":{"rendered":"nodejs \u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\uff08\u66f4\u65b0\uff09\u3059\u308b\u305f\u3073\u306b\u30b5\u30fc\u30d0\u3092\u518d\u8d77\u52d5\u3055\u305b\u308b"},"content":{"rendered":"<p>nodejs\u3067\u958b\u767a\u3092\u884c\u3063\u3066\u3044\u3066\u3001<\/p>\n<p>\u30b5\u30fc\u30d0\u5074\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3059\u308b\u305f\u3073\u306b<\/p>\n<p>\u30b5\u30fc\u30d0\u3092\u505c\u6b62\u3055\u305b\u3001\u518d\u8d77\u52d5\u3059\u308b\u3068\u3044\u3046\u4f5c\u696d\u304c\u9762\u5012\u306a\u305f\u3081\u3001<\/p>\n<p>\u7de8\u96c6\u3059\u308b\u305f\u3073\u306b\u30b5\u30fc\u30d0\u304c\u81ea\u52d5\u3067\u518d\u8d77\u52d5\u3059\u308b\u3088\u3046\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u307e\u305a\u79c1\u304c\u4f7f\u7528\u3057\u3088\u3046\u3068\u3057\u305f\u306e\u306f\u3001\u300cinotify-tools\u300d\u3068\u3044\u3046\u3082\u306e\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u3053\u308c\u3060\u3068\u30b3\u30f3\u30bd\u30fc\u30eb\u304b\u3089\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3059\u308b\u5206\u306b\u306f\u3001\u554f\u984c\u306a\u3044\u3067\u3059\u304c\u3001vscode\u304b\u3089\u7de8\u96c6\u3057\u305f\u5834\u5408\u306b\u306f\u3001\u691c\u77e5\u304c\u3067\u304d\u305a\u3001\u30b5\u30fc\u30d0\u3092\u518d\u8d77\u52d5\u3057\u3066\u3082\u3089\u3048\u306a\u3044\u3002<\/p>\n<p>\u56f0\u3063\u305f\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u76e3\u8996\u3059\u308b\u305f\u3081\u306e\u30b7\u30a7\u30eb\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"line-numbers\"><code class=\"language-markup\">#!\/bin\/bash\r\nDIR=[\u76e3\u8996\u30c7\u30a3\u30ec\u30af\u30c8\u30ea]\r\nwhile true\r\ndo\r\n  TMP=$(stat $(find $DIR))\r\n  while true\r\n  do\r\n    TMP2=$(stat $(find $DIR))\r\n    if [ \"$TMP\" !=  \"$TMP2\" ] ; then\r\n\t\tPID=$(ps -e | grep node | awk '{print $1}')\r\n\t\tif [ ! -z \"$PID\" ]; then\r\n\t\t  sudo kill -9  $PID\r\n\t\tfi\r\n\t\tcd [\u30b5\u30fc\u30d0\u30d5\u30a1\u30a4\u30eb\u307e\u3067\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea]\r\n\t\tnode [\u30b5\u30fc\u30d0\u30d5\u30a1\u30a4\u30eb] &amp;\r\n       break\r\n    fi\r\n    sleep 1\r\n  done\r\ndone<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>1\u79d2\u3054\u3068\u306b\u78ba\u8a8d\u3092\u884c\u3044\u3001\u76e3\u8996\u3057\u3066\u3044\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u5c11\u3057\u3067\u3082\u5909\u66f4\u304c\u3042\u308c\u3070\u3001nodejs\u30b5\u30fc\u30d0\u3092\u518d\u8d77\u52d5\u3055\u305b\u307e\u3059\u3002<\/p>\n<p>\u3061\u3087\u3063\u3068\u5f37\u5f15\u3067\u3059\u304c\u3001\u3053\u3061\u3089\u3092\u4f7f\u7528\u3059\u308c\u3070\u3001\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u3092\u63a2\u77e5\u3057\u3066\u3001\u30b5\u30fc\u30d0\u3092\u518d\u8d77\u52d5\u3055\u305b\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u5b9f\u306f...<\/h2>\n<p>\u3053\u3053\u307e\u3067\u8aad\u3093\u3067\u304f\u308c\u305f\u65b9\u306b\u6717\u5831\u3067\u3059\u3002<\/p>\n<p>\u30b7\u30a7\u30eb\u3092\u4f5c\u6210\u3057\u306a\u304f\u3066\u3082\u3001\u300chotnode\u300d\u3068\u3044\u3046\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u81ea\u52d5\u3067\u30b5\u30fc\u30d0\u3092\u518d\u8d77\u52d5\u3057\u3066\u304f\u308c\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\n<p>\u306a\u3093\u3066\u3053\u3063\u305f...\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>nodejs\u3067\u958b\u767a\u3092\u884c\u3063\u3066\u3044\u3066\u3001 \u30b5\u30fc\u30d0\u5074\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3059\u308b\u305f\u3073\u306b \u30b5\u30fc\u30d0\u3092\u505c\u6b62\u3055\u305b\u3001\u518d\u8d77\u52d5\u3059\u308b\u3068\u3044\u3046\u4f5c\u696d\u304c\u9762\u5012\u306a\u305f\u3081\u3001 \u7de8\u96c6\u3059\u308b\u305f\u3073\u306b\u30b5\u30fc\u30d0\u304c\u81ea\u52d5\u3067\u518d\u8d77\u52d5\u3059\u308b\u3088\u3046\u8a2d\u5b9a\u3057\u307e\u3057\u305f\u3002 &nbsp; \u307e\u305a\u79c1\u304c\u4f7f\u7528\u3057\u3088\u3046\u3068\u3057\u305f\u306e\u306f\u3001\u300cinotif\u2026<\/p>\n","protected":false},"author":3,"featured_media":1902,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[62,64],"tags":[],"class_list":["post-969","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-it","category-nodejs"],"_links":{"self":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/posts\/969","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/comments?post=969"}],"version-history":[{"count":0,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/posts\/969\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/media\/1902"}],"wp:attachment":[{"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/media?parent=969"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/categories?post=969"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/took.jp\/tech-blog\/wp-json\/wp\/v2\/tags?post=969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}