{"action":"created","issue":{"url":"https://api.github.com/repos/nodeschool/discussions/issues/2268","repository_url":"https://api.github.com/repos/nodeschool/discussions","labels_url":"https://api.github.com/repos/nodeschool/discussions/issues/2268/labels{/name}","comments_url":"https://api.github.com/repos/nodeschool/discussions/issues/2268/comments","events_url":"https://api.github.com/repos/nodeschool/discussions/issues/2268/events","html_url":"https://github.com/nodeschool/discussions/issues/2268","id":300718614,"node_id":"MDU6SXNzdWUzMDA3MTg2MTQ=","number":2268,"title":"learnyounode - exercise 6","user":{"login":"ghost","id":10137,"node_id":"MDQ6VXNlcjEwMTM3","avatar_url":"https://avatars3.githubusercontent.com/u/10137?v=4","gravatar_id":"","url":"https://api.github.com/users/ghost","html_url":"https://github.com/ghost","followers_url":"https://api.github.com/users/ghost/followers","following_url":"https://api.github.com/users/ghost/following{/other_user}","gists_url":"https://api.github.com/users/ghost/gists{/gist_id}","starred_url":"https://api.github.com/users/ghost/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghost/subscriptions","organizations_url":"https://api.github.com/users/ghost/orgs","repos_url":"https://api.github.com/users/ghost/repos","events_url":"https://api.github.com/users/ghost/events{/privacy}","received_events_url":"https://api.github.com/users/ghost/received_events","type":"User","site_admin":false},"labels":[{"id":690479662,"node_id":"MDU6TGFiZWw2OTA0Nzk2NjI=","url":"https://api.github.com/repos/nodeschool/discussions/labels/inactive","name":"inactive","color":"ffffff","default":false},{"id":66549491,"node_id":"MDU6TGFiZWw2NjU0OTQ5MQ==","url":"https://api.github.com/repos/nodeschool/discussions/labels/learnyounode","name":"learnyounode","color":"F0A028","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-02-27T17:15:04Z","updated_at":"2018-08-29T05:35:11Z","closed_at":"2018-04-09T22:12:06Z","author_association":"NONE","body":"\r\nthis is the learnyounode Exercise 6. All tests pass, and the result is right when compared. but this error is displayed at the end of the test.\r\n\r\n### Error output\r\n```\r\n \r\nyour additional module file is: [filter.js] ?exercises.MAKE IT\r\n MODULAR.fail.mod.dont_use_dot || common.exercise.fail.mod.dont_use_dot ||\r\n fail.mod.dont_use_dot?\r\n\r\n```\r\n\r\n### My Code\r\n```js\r\n//####index.js\r\n\r\nconst filter = require('./filter')\r\n\r\nlet folder = process.argv[2]\r\nlet ext = '.' + process.argv[3]\r\n\r\nfunction callback(err, data) {\r\n\tif (err) return 'error'\r\n\tfor (let i = 0; i < data.length; i++) {\r\n\t\tconsole.log(data[i])\r\n\t}\r\n\r\n}\r\n\r\nfilter(folder,ext, callback)\r\n\r\n //####filter.js\r\nconst fs = require('fs')\r\nconst path = require('path')\r\n\r\nlet filesArray = []\r\n\r\nfunction readDir(folder, ext, callback) {\r\n  fs.readdir(folder, function (err, files) {\r\n    if (err) return callback(err, null)\r\n\r\n    files.forEach(function (file) {\r\n      if (path.extname(file) === ext) {\r\n        filesArray.push(file)\r\n      }\r\n    })\r\n    callback(null, filesArray)\r\n  })\r\n}\r\n\r\nmodule.exports = readDir \r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/nodeschool/discussions/issues/comments/416829896","html_url":"https://github.com/nodeschool/discussions/issues/2268#issuecomment-416829896","issue_url":"https://api.github.com/repos/nodeschool/discussions/issues/2268","id":416829896,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNjgyOTg5Ng==","user":{"login":"yongqiangyue","id":1995136,"node_id":"MDQ6VXNlcjE5OTUxMzY=","avatar_url":"https://avatars0.githubusercontent.com/u/1995136?v=4","gravatar_id":"","url":"https://api.github.com/users/yongqiangyue","html_url":"https://github.com/yongqiangyue","followers_url":"https://api.github.com/users/yongqiangyue/followers","following_url":"https://api.github.com/users/yongqiangyue/following{/other_user}","gists_url":"https://api.github.com/users/yongqiangyue/gists{/gist_id}","starred_url":"https://api.github.com/users/yongqiangyue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yongqiangyue/subscriptions","organizations_url":"https://api.github.com/users/yongqiangyue/orgs","repos_url":"https://api.github.com/users/yongqiangyue/repos","events_url":"https://api.github.com/users/yongqiangyue/events{/privacy}","received_events_url":"https://api.github.com/users/yongqiangyue/received_events","type":"User","site_admin":false},"created_at":"2018-08-29T05:35:11Z","updated_at":"2018-08-29T05:35:11Z","author_association":"NONE","body":"`// index.js\r\nlet listext= require('./lsmodule.js');\r\n\r\nlet folder = process.argv[2];\r\nlet ext = process.argv[3];\r\n\r\nlistext(folder, ext, (err, files) =>{\r\nif(err) return console.error(err);\r\nfiles.forEach(file =>{\r\nconsole.log(file);\r\n});\r\n});\r\n\r\n// lsmodule.js\r\nconst fs = require('fs');\r\nconst path = require('path');\r\n\r\nfunction listext(folder, ext, callback){\r\nfs.readdir(folder, (err, files) =>{\r\nif(err){\r\nreturn callback(err, null);\r\n}\r\ncallback(null, files.filter(file =>{\r\nreturn path.extname(file) === '.' + ext; //\r\n}));\r\n});\r\n}\r\n\r\nmodule.exports= listext;`"}}
{"actor":{"display_login":"yongqiangyue"}}