{"action":"closed","issue":{"url":"https://api.github.com/repos/nodeschool/discussions/issues/1304","labels_url":"https://api.github.com/repos/nodeschool/discussions/issues/1304/labels{/name}","comments_url":"https://api.github.com/repos/nodeschool/discussions/issues/1304/comments","events_url":"https://api.github.com/repos/nodeschool/discussions/issues/1304/events","html_url":"https://github.com/nodeschool/discussions/issues/1304","id":95678730,"number":1304,"title":"Exercise 6: Make It Modular - Does not export a single function","user":{"login":"jonathantzh","id":10126769,"avatar_url":"https://avatars.githubusercontent.com/u/10126769?v=3","gravatar_id":"","url":"https://api.github.com/users/jonathantzh","html_url":"https://github.com/jonathantzh","followers_url":"https://api.github.com/users/jonathantzh/followers","following_url":"https://api.github.com/users/jonathantzh/following{/other_user}","gists_url":"https://api.github.com/users/jonathantzh/gists{/gist_id}","starred_url":"https://api.github.com/users/jonathantzh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonathantzh/subscriptions","organizations_url":"https://api.github.com/users/jonathantzh/orgs","repos_url":"https://api.github.com/users/jonathantzh/repos","events_url":"https://api.github.com/users/jonathantzh/events{/privacy}","received_events_url":"https://api.github.com/users/jonathantzh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodeschool/discussions/labels/learnyounode","name":"learnyounode","color":"F0A028"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-07-17T15:23:54Z","updated_at":"2015-08-29T06:30:01Z","closed_at":"2015-08-29T06:30:01Z","body":"Encountered an issue with Exercise 6: Make It Modular. Here's my code:\r\n\r\nfilterlist.js:\r\n```js\r\nlistmodule = require('./listmodule.js');\r\nvar listdir= process.argv[2];\r\nvar extStr = process.argv[3];\r\n\r\nlistmodule(listdir, extStr, function(err, data) {\r\n    if (err) {\r\n        return console.log(err)\r\n    }\r\n    else {\r\n        console.log(data);\r\n    }\r\n})\r\n```\r\nlistmodule.js:\r\n```js\r\nvar fs = require('fs');\r\nvar path = require('path');\r\nvar data = '';\r\n\r\nmodule.exports = function(listdir, extStr, callback){\r\n    fs.readdir(listdir, function(err, list) {\r\n        if (err) {\r\n            return callback(err);\r\n        }\r\n        for (i=0; i<=list.length-1; i++) {\r\n            if (path.extname(list[i]) == '.' + extStr) {\r\n                data = data + list[i] + '\\n'\r\n            }\r\n        }\r\n        callback(null, data);\r\n    })\r\n}\r\n```\r\n\r\nMy results match the expected results but I'm failing with the message, \"? Your additional module file [filterlist.js] does not export a single function. You must use the module.exports = function () {} pattern.\"\r\n\r\nAny help would be appreciated, thanks!"}}