Node.jsã§Top-Level Awaitããµãã¼ãããï¼ã¦ï¼ãã®ã§ãéåæéä¿¡ã¨è¨ãã°ãªaxiosã§è©¦ãã¦ã¿ã¾ãã ä»ã¾ã§ã¯awaitãå©ç¨ããéã«ãasyncé¢æ°å ãããªãã¨ä½¿ãã¾ããã§ããããasyncé¢æ°ã宣è¨ããã«awaitã使ããããã«ãªãã¾ãã v14.3.0ã§ãµãã¼ããv14.8.0ã§ãã©ã°ãªã v 14.3.0 Top-Level Awaitã¯Node.js v14.3.0ã§ãµãã¼ãããã¾ãããããã®æç¹ã ã¨--experimental-top-level-awaitã®ãã©ã°ãä»ãã¦å®è¡ããå¿ è¦ãããã¾ããã v 14.8.0 v14.8.0以éã§ãã©ã°ç¡ãã§å©ç¨ã§ãã¾ãã axiosã§å©ç¨ãã¦ã¿ã (ä¸å¿)ä»å試ããç°å¢ã¯Node.js v14.14.0ã§ãã package.jsonã«"type": "module"ã追è¨ãã¦å©ç¨ã§ãã¾ãã ã¾ããæ¡å¼µåãmjsã«
2018å¹´ 1æ2æ¥ 17æ05å 5å¹´å node.jsã§ãã¼ã«ã«ã¢ã¸ã¥ã¼ã«ãå¼ã³åºãæã«ä¾¿å©ãªã©ã¤ãã©ãªãnode-app-root-pathãã®ç´¹ä»ã§ãã node.jsã§ã¢ã¸ã¥ã¼ã«ã使ãæ㯠' require ' ã¡ã½ããã使ã£ã¦å¼ã³åºãã¾ãã ããã©ã«ãã§ã¯ ' node_modules ' ãã©ã«ãããã¢ã¸ã¥ã¼ã«ãå¼ã³åºããã¾ããããã¼ã«ã«ã¢ã¸ã¥ã¼ã« (ç¹å®ã®ãã£ã¬ã¯ããª) ãå¼ã³åºãæã¯ãç¸å¯¾ãã¹ ( ../../ ãªã© ) ã使ãã¾ãããªã®ã§ãé層ãæ·±ãå ´æãããµããã£ã¬ã¯ãå ã®ãã¡ã¤ã«ãå¼ã³åºãæã¯ããã£ããä»ã©ã®ãã¹ãåç §ãã¦ããã®ããããã¨ã¯ã±ãåãããªãäºãããããã¾ãã // ç¸å¯¾ãã¹ã使ã£ã¦ãã¼ã«ã«ã¢ã¸ã¥ã¼ã«ãå¼ã³åºãä¾ const Pagination = require("../../Database/Pagination"); const current
ããã§ã¯ãNode.js ç¨ã® AWS SDK ver.2 ã使ã£ã¦ Amazon DynamoDB ãæä½ããæ¹æ³ã説æãã¾ãã TypeScript ã®åºæ¬çãªç°å¢æ§ç¯ ã¯çµãã£ã¦ãããã®ã¨ãã¾ãã SDK ver.3 ã使ãæ¹æ³ã¯ãã¡ãã®è¨äº ãåç §ãã¦ãã ããã åºæ¬çã«ã¯ ver.3 ã®ä½¿ç¨ãæ¨å¥¨ããã¦ãã¾ãããAWS ã® Lambda å®è¡ç°å¢ã¯ç¾æç¹ï¼2021å¹´5æï¼ã§ã ver.2 ãã¤ã³ã¹ãã¼ã«ããã¦ãããããã®ã§ãver.2 ã®éè¦ã¯ã¾ã ããã¨æãã¾ãã Dynamo DB ç¨ã® SDK (ver.2) ãã¤ã³ã¹ãã¼ã«ããAWS SDK version 2 㧠DynamoDB ãæ±ãã«ã¯ã次ã®ããã« AWS SDK ããã±ã¼ã¸å ¨ä½ãã¤ã³ã¹ãã¼ã«ããå¿ è¦ãããã¾ãï¼version 3 ã§ã¯ DynamoDB ãµã¼ãã¹ãªã©ã®ããã±ã¼ã¸ãåå¥ã«ã¤ã³ã¹ãã¼ã«ã§ãã¾ãï¼ã
ãããªããã°ã©ã ã§CSVãã¡ã¤ã«ãä½æã const fs = require('fs');const lines = [    'ãã£ã¼ã«ãåï¼,ãã£ã¼ã«ãåï¼,ãã£ã¼ã«ãåï¼',    'å¤ï¼ï¼ï¼,å¤ï¼ï¼ï¼,å¤ï¼ï¼ï¼',    'å¤ï¼ï¼ï¼,å¤ï¼ï¼ï¼,å¤ï¼ï¼ï¼',    'å¤ï¼ï¼ï¼,å¤ï¼ï¼ï¼,å¤ï¼ï¼ï¼',];const text = lines.join('\n');fs.writeFile('output.csv', text, (err) => {    if (err) throw err;    console.log('åºåãã¾ããã');}); Excelã§éãã¨æååããã¾ãã ãã¼ã¿ã®å é ã«BOMã\ufeffããä»ä¸ãã¦ããã¨åé¿ã§ãã¾ãã const fs = require('fs');const lines = [    'ãã£ã¼ã«ãåï¼,ãã£ã¼ã«ãåï¼,ãã£ã¼ã«
Overview ãã©ã«ããé ä¸ã®ãã¡ã¤ã«ãå«ãã¦ä¸æ¬åé¤ããããã¨æã£ããæå¤ã¨é渡æã§ãããã¨ãå¤æã ã°ã°ãã¨å¤ãã³ã¼ããä¸ä½ã«ããããã2019年以éã®ãã©ã«ãåé¤ã®æ¹æ³ãæ®ãã¦ããã Target reader Node.jsã§ãã©ã«ãããã¡ã¤ã«ãå«ãã¦ã¹ãã¼ãã«åé¤ãããæ¹ã Prerequisite ãªãã Body Special thanks ä»åã¯stack overflowã®å 容ããªããã ããªã®ã§ãå¿ è¦ã«å¿ãã¦ãªã³ã¯å ã確èªãã¦ãã ããã Remove directory which is not empty https://stackoverflow.com/questions/18052762/remove-directory-which-is-not-empty Node v12.10以éã®å ´å ãã®åçããã¹ã¦ã https://stackoverflow.c
ãã¡ã¤ã«ãåé¤ããã«ã¯ã次ã®é¢æ°ã使ç¨ãã¾ãã fs.unlinkSync(path) fs.unlink(path, callback) fs.unlinkSync(path) fs.unlinkSync(path)ã¯ãå¼æ°pathã«åé¤ãããã¡ã¤ã«ã®ãã¹ãåãã¾ãã æå®ãããpathã®ãã¡ã¤ã«ãåå¨ããªãå ´åãä¾å¤ãæãã¾ãã const fs = require('fs'); try { fs.unlinkSync('path/file.txt'); console.log('åé¤ãã¾ããã'); } catch (error) { throw error; } fs.unlink(path, callback) fs.unlink(path, callback)ã¯ãå¼æ°pathã«åé¤ãããã¡ã¤ã«ã®ãã¹ãåãã¾ãã é¢æ°callbackã¯ããã¡ã¤ã«ãåå¨ããªãå ´åã«å¼æ°errã¯ã¨ã©
AWS SDKãå©ç¨ãã¦DynamoDBãæä½ããæ¹æ³ã«ã¤ãã¦ç¢ºèªãã¾ããããã¼ãã«ä½æã»åé¤ããã¢ã¤ãã ã®æ¿å ¥ã»åå¾ã»æ´æ°ã»åé¤ãã«ã¤ãã¦åãä¸ãã¾ãã const AWS = require('aws-sdk') AWS.config.loadFromPath('./config.json') const dynamoDB = new AWS.DynamoDB() const params = { TableName: 'users', AttributeDefinitions: [ { AttributeName: 'user_id', AttributeType: 'N' }, // number { AttributeName: 'created_at', AttributeType: 'S' }, // string { AttributeName: 'post_id', At
ããã«ã¡ã¯ãã®ã³ããã§ãã Node.jsã§Gmailãå¶å¾¡ããæ¹æ³ã¯ãéå»ã«è²ã ãªè¨äºãåºã¦ããã®ã§ãããå ¨ä½çã«è¨äºãå¤ããGmail API Node.js Quickstartã®ãã¥ã¼ããªã¢ã«ãå²ã¨ãããã«ãããªãã¨ããå°è±¡ã§ããè±èªãããªããã ã¾ããåæã©ã¤ãã©ãªãå¤ãã®ã§ããã¡ã³ããã³ã¹ããã¦ãªãå©ç¨ãã¦ããéã®ä¸å®ãå¤ãã§ãã ã¨ãããã¨ã§ãä»æ¥ã¯Node.jsã§Gmailã使ãæ¹æ³ã®ç´¹ä»ã§ãã 以åæ¸ããSpreadSheetsè¨äºãåæ§ã®Google APIã©ã¤ãã©ãªãå©ç¨ãã¦ããã®ã§åºæ¬çãªæé ã¯åãã§ãã Gmail APIã®æå¹åã¨ã¯ã©ã¤ã¢ã³ãã·ã¼ã¯ã¬ããã®åå¾ãã¡ãã®ãªã³ã¯ããã¦ã£ã¶ã¼ãéå§ãã¾ãããã°ã¤ã³ãã¦ããGoogleã¢ã«ã¦ã³ããå©ç¨ããGmailã®ã¢ã«ã¦ã³ãã«ãªãã®ã§è¤æ°ã®GoogleãG Suiteã®ã¢ã«ã¦ã³ããæã£ã¦ãã人ã¯æ³¨æãã¾ãããã ãã§ã
ä¹ ãã¶ãã«Gmail APIã®ãã¥ã¼ããªã¢ã«ãè¦ããã¢ãããã¼ãããã¦ãã®ã§è©¦ãã¦ã¿ã¾ããã ããã§ã¯ã ç¹å®ã®ã¡ã¼ã«ããå±ãã¦ãã¡ã¼ã«ã®ææ°ã®å¤ãåå¾ãã¦ã¿ã¾ãã èªè¨¼æ å ±ã®æºå Googleå ¬å¼ã©ã¤ãã©ãªãå©ç¨ãã¦Node.jsããGmailã®éåä¿¡ããã¦ã¿ãããå ¬å¼ãã¥ã¼ããªã¢ã«ãåèã«ãã¯ã¬ãã³ã·ã£ã«ã¨ãã¼ã¯ã³ã®æ å ±ãåå¾ãã¾ãããã ã¹ã³ã¼ã ã¡ã½ããçã«ã¯ãgmail.users.messages.listã¨gmail.users.messages.getãå©ç¨ãã¾ãã åè: https://developers.google.com/gmail/api/reference/rest/v1/users.messages/list åè: https://developers.google.com/gmail/api/reference/rest/v1/users.messag
ã¿ã° Node.js ã®æ°ããè¨äºNode.js http-serverãhttpsã§åãã (2023-02-12)TypeScriptã§JSON Web Tokenã®ä½æã¨æ¤è¨¼ãè¡ã (2021-11-06)WSL2 + Docker + VSCode ã§åã PHP 7.2 + Node.js 14 + MariaDB 10.5 + Nginx ã®éçºç°å¢ (2021-10-12)WSLã®Ubuntu18㧠Node.js 13.12 ã®éçºç°å¢ä½ãã¡ã¢ (2020-04-05)Node.jsã§è²ããªãã¹ãåå¾ (2020-04-03)
Node.jsã§CSVãã¡ã¤ã«ãèªã¿è¾¼ãã ããä¿åãããããæ¹æ³ã§ããèªåã§æååãæä½ããªãã¦ãã©ã¤ãã©ãªã使ããã¨ã§èªåã§ãªãã¸ã§ã¯ãã¨ã®å¤æãè¡ã£ã¦ããã¾ãã ã¾ããExpressã§ç´æ¥ãã¦ã³ãã¼ãããããµã³ãã«ãè¼ãã¦ãã¾ãã 2022.09.09 ãµã³ãã«ãåã¢ã¸ã¥ã¼ã«ã®æ°ãããã¼ã¸ã§ã³ã«ä¿®æ£ãã¾ããã æ¬è¨äºã®ãµã³ãã«åä½ãã¼ã¸ã§ã³ csv-parse - 5.3.0 csv-stringify - 6.2.0 iconv-lite - 0.6.3 CSVãã¡ã¤ã«ãèªã¿è¾¼ã csv-parseã使ããã¨ã§ãCSVããªãã¸ã§ã¯ãã®é åãé åã®é åã«èªã¿è¾¼ã¿ãã¨ãã§ãã¾ãã csv-parseã®ã¤ã³ã¹ãã¼ã« npm install csv-parse Excelãªã©ã§ä½æããShift-JISã®CSVãã¡ã¤ã«ãéãããã«ã¯iconv-liteãã¤ã³ã¹ãã¼ã«ãã¾ãã npm inst
ããã·ã¥ï¼hashï¼ã¨GETãã©ã¡ã¼ã¿ï¼searchï¼ãæ··å¨ããURLã«ã¤ãã¦ã¯ãå ¨ã¦ããã·ã¥ï¼hashï¼ã«å«ã¾ãã¦ãã¾ããã注æãå¿ è¦ã§ãã 以ä¸ã®ä¾ã¯GETãã©ã¡ã¼ã¿ãã¦ã¼ã¶ã¼åããã¹ã¯ã¼ããé¤ããURLã§åããããã£ã®å¤ãåºåãã¾ãã index.js // https://gray-code.com:4000/test/index.html#section1 ããURLãªãã¸ã§ã¯ããä½æ var uri = new URL(window.location.href); console.log(uri.hash); // #section1 console.log(uri.host); // gray-code.com:4000 console.log(uri.hostname); // gray-code.com console.log(uri.href); // https://
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}