{"id":40894,"date":"2016-07-22T00:11:06","date_gmt":"2016-07-21T15:11:06","guid":{"rendered":"http:\/\/www.softantenna.com\/wp\/?p=40894"},"modified":"2016-07-22T00:11:06","modified_gmt":"2016-07-21T15:11:06","slug":"awkward","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/awkward\/","title":{"rendered":"Awkward - \u884c\u6307\u5411\u306f\u53e4\u3059\u304e\u308b\uff01\u5168\u3066\u304c\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u8868\u73fe\u3055\u308c\u305fNodeJS\u88fd\u306e\u30b7\u30a7\u30eb"},"content":{"rendered":"<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2016\/07\/s-2016-07-21-23.48.32.jpg\" alt=\"S 2016 07 21 23 48 32\" title=\"s 2016-07-21 23.48.32.jpg\" border=\"0\" width=\"794\" height=\"476\" \/><\/p>\n<p>\u5c0f\u3055\u306a\u30c4\u30fc\u30eb\u3092\u30d1\u30a4\u30d7\u3092\u99c6\u4f7f\u3057\u3066\u7d44\u307f\u5408\u308f\u305b\u308bUNIX\u54f2\u5b66\u3002\u884c\u6307\u5411\u306e\u30c7\u30fc\u30bf\u3092\u52b9\u7387\u826f\u304f\u51e6\u7406\u3059\u308b\u65b9\u6cd5\u3092\u77e5\u308b\u7269\u304c\u52dd\u8005\u3068\u306a\u308b\u74b0\u5883\u3067\u3059\u3002<\/p>\n<p>\u5bfe\u3057\u3066\u672c\u65e5\u7d39\u4ecb\u3059\u308b\u300c<a href=\"https:\/\/github.com\/iostreamer-X\/Awkward\">Awkward<\/a>\u300d\u306f\u3001\u884c\u6307\u5411\u3067\u306f\u306a\u304fJavaScript\u306e\u914d\u5217\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30e6\u30cb\u30fc\u30af\u306a\u30b7\u30a7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3059\u3002NodeJS\u88fd\u306e\u30c4\u30fc\u30eb\u3067\u3001npm\u3092\u4f7f\u7528\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>\nnpm install -g awkward\n<\/pre>\n<p>Awkward\u3067\u306f\u30b7\u30a7\u30eb\u30b3\u30de\u30f3\u30c9\u3084\u305d\u306e\u4ed6\u5b9f\u884c\u30d5\u30a1\u30a4\u30eb\u306e\u51fa\u529b\u3092\u3001JavaScript\u306e\u914d\u5217\u3068\u3057\u3066\u53d6\u308a\u6271\u3044\u3001Array\u306emap\u3001forEach\u3001filter\u3068\u3044\u3063\u305f\u30e1\u30bd\u30c3\u30c9\u3092\u9069\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070ps\u3092\u5b9f\u884c\u3059\u308b\u5834\u5408\u3001\u30b7\u30a7\u30eb\u306e\u6a19\u6e96\u51fa\u529b\u304c\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u914d\u5217\u306b\u5909\u63db\u3055\u308c\u308b\u306e\u3067\u3059\u3002<\/p>\n<p><span class=\"mybold\">\u30b7\u30a7\u30eb\u51fa\u529b<\/span>:<\/p>\n<pre>\nPID TTY          TIME CMD\n13750 pts\/14   00:00:00 bash\n25193 pts\/14   00:00:03 node\n25271 pts\/14   00:00:00 sh\n25272 pts\/14   00:00:00 ps\n<\/pre>\n<p><span class=\"mybold\">\u914d\u5217<\/span>:<\/p>\n<pre>\n[ [ 'PID', 'TTY', 'TIME', 'CMD' ],\n[ '13750', 'pts\/14', '00:00:00', 'bash' ],\n[ '25193', 'pts\/14', '00:00:03', 'node' ],\n[ '25283', 'pts\/14', '00:00:00', 'sh' ],\n[ '25284', 'pts\/14', '00:00:00', 'ps' ] ]\n<\/pre>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a55\u4fa1\u3059\u308b\u3053\u3068\u3067\u7d50\u679c\u3092\u81ea\u7531\u306b\u52a0\u5de5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre>\n(command).function((elem)=>{})\n<\/pre>\n<p>\u4f8b\u3048\u3070ls\u3092\u5b9f\u884c\u3057\u30d5\u30a1\u30a4\u30eb\u540d\u3068\u305d\u306e\u9577\u3055\u3092\u8868\u793a\u3059\u308b\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>\nsora@awk ward:~$ ls().forEach(a => console.log(a[0], a[0].length))\nGemfile 7\nGemfile.lock 12\nREADME.rdoc 11\nRakefile 8\napp 3\nbin 3\nbuild.sh 8\nconfig 6\nconfig.ru 9\ndb 2\nhello.sh 8\nhello_parameter.sh 18\nlib 3\nlog 3\nout 3\npublic 6\nrails41-bootstrap-demo.iml 26\ntest 4\ntmp 3\nuntitled 8\nvendor 6\n<\/pre>\n<p>\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\u3068\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u8868\u793a\u3059\u308b\u306e\u3082\u7c21\u5358\u3067\u3059\u3002<\/p>\n<pre>\nsora@awk ward:~$ (ls -l)().forEach(a => console.log(a[4], a[8]))\nundefined undefined\n1439 Gemfile\n4045 Gemfile.lock\n295 README.rdoc\n249 Rakefile\n306 app\n170 bin\n342 build.sh\n374 config\n154 config.ru\n238 db\n189 hello.sh\n66 hello_parameter.sh\n136 lib\n204 log\n102 out\n238 public\n38441 rails41-bootstrap-demo.iml\n306 test\n204 tmp\n68 untitled\n136 vendor\n<\/pre>\n<p>\u5358\u4f53\u306e\u30b7\u30a7\u30eb\u3068\u3057\u3066\u306e\u6a5f\u80fd\u81ea\u4f53\u306f\u307e\u3060\u307e\u3060\u4e0d\u8db3\u6c17\u5473\u3067\u3059\u304c\u3001\u65b0\u305f\u306a\u30b7\u30a7\u30eb\u306e\u30a2\u30a4\u30c7\u30a2\u3068\u3057\u3066\u8208\u5473\u6df1\u3044\u3082\u306e\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<a href=\"https:\/\/news.ycombinator.com\/item?id=12128119\">Hacker News<\/a>\u3067\u3082\u30a2\u30a4\u30c7\u30a2\u306e\u65ac\u65b0\u3055\u304b\u3089\u3001\u591a\u304f\u306e\u30b3\u30e1\u30f3\u30c8\u304c\u5bc4\u305b\u3089\u308c\u3066\u3044\u307e\u3059\u3002awk\u3084sed\u306e\u5947\u5999\u306a\u69cb\u6587\u306b\u306f\u6211\u6162\u3067\u304d\u306a\u3044\u3068\u3044\u3046\u65b9\u306f\u8a66\u3057\u3066\u307f\u308b\u3068\u65b0\u305f\u306a\u767a\u898b\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5c0f\u3055\u306a\u30c4\u30fc\u30eb\u3092\u30d1\u30a4\u30d7\u3092\u99c6\u4f7f\u3057\u3066\u7d44\u307f\u5408\u308f\u305b\u308bUNIX\u54f2\u5b66\u3002\u884c\u6307\u5411\u306e\u30c7\u30fc\u30bf\u3092\u52b9\u7387\u826f\u304f\u51e6\u7406\u3059\u308b\u65b9\u6cd5\u3092\u77e5\u308b\u7269\u304c\u52dd\u8005\u3068\u306a\u308b\u74b0\u5883\u3067\u3059\u3002 \u5bfe\u3057\u3066\u672c\u65e5\u7d39\u4ecb\u3059\u308b\u300cAwkward\u300d\u306f\u3001\u884c\u6307\u5411\u3067\u306f\u306a\u304fJavaScript\u306e\u914d\u5217\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u3092 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":40895,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[3459],"tags":[655,1787,1383,3302],"class_list":["post-40894","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-review","tag-javascript","tag-node-js","tag-shell","tag-unix"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/40894","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=40894"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/40894\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/40895"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=40894"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=40894"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=40894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}