{"id":399,"date":"2024-04-17T07:10:29","date_gmt":"2024-04-17T07:10:29","guid":{"rendered":"https:\/\/www.freelifemakers.org\/wordpress\/?p=399"},"modified":"2024-04-17T08:15:51","modified_gmt":"2024-04-17T08:15:51","slug":"npm-moment-module","status":"publish","type":"post","link":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/2024\/04\/17\/npm-moment-module\/","title":{"rendered":"NPM moment module"},"content":{"rendered":"\n<p>nodejs\ub97c \uc124\uce58 \ud558\uace0 npm\uba85\ub839\uc5b4\ub97c \ud1b5\ud558\uc5ec \ud328\ud0a4\uc9c0\ub97c \uc124\uce58 \ud558\uba74 \uc0ac\uc6a9 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<br>\uae30\ubcf8 \uc801\uc778 \ud328\ud0a4\uc9c0 \uc124\uce58 \uba85\ub839\uc5b4\ub294 \uc544\ub798\uc640 \uac19\uc2b5\ub2c8\ub2e4.<br>You can use it by installing nodejs and installing the package through the npm command.<br>The basic package installation command is as follows.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># npm install moment<\/code><\/pre>\n\n\n\n<p>moment\ubaa8\ub4c8\uc758 \uc6a9\ub3c4\ub294 JavaScript\ub85c \ub0a0\uc9dc\uc640 \uc2dc\uac04\uc744 \uad6c\ubb38 \ubd84\uc11d, \uac80\uc99d, \uc870\uc791 \ubc0f \ud45c\uc2dc\ub97c \ud558\uae30 \uc704\ud574\uc11c \uc0ac\uc6a9\ud569\ub2c8\ub2e4.<br>(memonet\uc6f9\uc0ac\uc774\ud2b8 \ucc38\uc870)<br>moment \ubaa8\ub4c8\uc758 \uae30\ubcf8\uc801\uc778 \uc0ac\uc6a9\ubc29\ubc95\uc740 <a rel=\"noreferrer noopener\" href=\"https:\/\/momentjs.com\/\" target=\"_blank\">https:\/\/momentjs.com\/<\/a> \uccab\ud398\uc774\uc9c0\uc5d0\uc11c \ud655\uc778 \ud560 \uc218 \uc788\ub2e4.<br>The purpose of the moment module is to parse, verify, manipulate, and display dates and times in JavaScript.<br>(Refer to memonet website)<br>Basic instructions for using the moment module can be found on the first page of <a href=\"https:\/\/momentjs.com\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/momentjs.com<\/a><br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"891\" height=\"929\" src=\"https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2024\/04\/momentjs-1.png\" alt=\"\" class=\"wp-image-408\" srcset=\"https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2024\/04\/momentjs-1.png 891w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2024\/04\/momentjs-1-288x300.png 288w, https:\/\/www.freelifemakers.org\/wordpress\/wp-content\/uploads\/2024\/04\/momentjs-1-768x801.png 768w\" sizes=\"auto, (max-width: 891px) 100vw, 891px\" \/><\/figure>\n\n\n\n<p>\uc544\ub798\ub294 moment\ub97c \uc0ac\uc6a9\ud558\ub294 sever.js \uc608\uc81c \ucf54\ub4dc \uc785\ub2c8\ub2e4.<br>Below is sever.js example code using moment.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>const http = require('http');\nconst moment = require('moment');\n\nconst server = http.createServer((req, res) =&gt; {\n    res.writeHead(200, { 'Content-Type': 'text\/plain' });\n    res.end('CommonJS:Hello World!\\n');\n  });\n\n\/\/ moment package \n\/\/ usage : https:\/\/momentjs.com\/\nconst mtime = moment().format('MMMM Do YYYY, h:mm:ss a');\nconst mtimes = moment().format('LT');\nconsole.log(mtime);\nconsole.log(mtimes);\n\n\n\/\/ Start the server\nconst PORT = process.env.PORT || 3000;\nserver.listen(PORT, () =&gt; {\n  console.log(`CommonJS:Server is running on port ${PORT}`);\n});\n<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<iframe loading=\"lazy\" src=\"https:\/\/www.facebook.com\/plugins\/video.php?height=314&#038;href=https%3A%2F%2Fwww.facebook.com%2Fgideonslife01%2Fvideos%2F445005488047846%2F&#038;show_text=false&#038;width=560&#038;t=0\" width=\"560\" height=\"314\" style=\"border:none;overflow:hidden\" scrolling=\"no\" frameborder=\"0\" allowfullscreen=\"true\" allow=\"autoplay; clipboard-write; encrypted-media; picture-in-picture; web-share\" allowFullScreen=\"true\"><\/iframe>\n","protected":false},"excerpt":{"rendered":"<p>nodejs\ub97c \uc124\uce58 \ud558\uace0 npm\uba85\ub839\uc5b4\ub97c \ud1b5\ud558\uc5ec \ud328\ud0a4\uc9c0\ub97c \uc124\uce58 \ud558\uba74 \uc0ac\uc6a9 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\uae30\ubcf8 \uc801\uc778 \ud328\ud0a4\uc9c0 \uc124\uce58 \uba85\ub839\uc5b4\ub294 \uc544\ub798\uc640 \uac19\uc2b5\ub2c8\ub2e4.You can use it by installing nodejs and installing the package through the npm command.The basic package installation command is as follows. moment\ubaa8\ub4c8\uc758 \uc6a9\ub3c4\ub294 JavaScript\ub85c \ub0a0\uc9dc\uc640 \uc2dc\uac04\uc744 \uad6c\ubb38 \ubd84\uc11d, \uac80\uc99d, \uc870\uc791 \ubc0f \ud45c\uc2dc\ub97c \ud558\uae30 \uc704\ud574\uc11c \uc0ac\uc6a9\ud569\ub2c8\ub2e4.(memonet\uc6f9\uc0ac\uc774\ud2b8 \ucc38\uc870)moment \ubaa8\ub4c8\uc758 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-399","post","type-post","status-publish","format-standard","hentry","category-nodejs","missing-thumbnail"],"_links":{"self":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/399","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=399"}],"version-history":[{"count":6,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/399\/revisions"}],"predecessor-version":[{"id":410,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/399\/revisions\/410"}],"wp:attachment":[{"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=399"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=399"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.freelifemakers.org\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}