{"action":"created","issue":{"url":"https://api.github.com/repos/danielstjules/pjs/issues/3","labels_url":"https://api.github.com/repos/danielstjules/pjs/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/danielstjules/pjs/issues/3/comments","events_url":"https://api.github.com/repos/danielstjules/pjs/issues/3/events","html_url":"https://github.com/danielstjules/pjs/issues/3","id":54879645,"number":3,"title":"templates","user":{"login":"akoenig","id":224910,"avatar_url":"https://avatars.githubusercontent.com/u/224910?v=3","gravatar_id":"","url":"https://api.github.com/users/akoenig","html_url":"https://github.com/akoenig","followers_url":"https://api.github.com/users/akoenig/followers","following_url":"https://api.github.com/users/akoenig/following{/other_user}","gists_url":"https://api.github.com/users/akoenig/gists{/gist_id}","starred_url":"https://api.github.com/users/akoenig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akoenig/subscriptions","organizations_url":"https://api.github.com/users/akoenig/orgs","repos_url":"https://api.github.com/users/akoenig/repos","events_url":"https://api.github.com/users/akoenig/events{/privacy}","received_events_url":"https://api.github.com/users/akoenig/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-20T12:55:12Z","updated_at":"2015-01-20T15:45:47Z","closed_at":null,"body":"@danielstjules, but what do you think of a template feature? Something where you can define CommonJS-style modules for repeating filter/map/reduce tasks, like:\r\n\r\n`~/.config/pjs/templates/debug-log.js`\r\n\r\n```javascript\r\nmodule.exports = function template (pjs) {\r\n    return pjs\r\n        .filter(function (item) {\r\n            return !!~item.indexOf('DEBUG');\r\n        })\r\n        .map(function (item) {\r\n            return \"Found debug entry: \" + item;\r\n        });\r\n\r\n        // omitting \"reduce\" here ...\r\n};\r\n```\r\n\r\ncould be used in `pjs` as:\r\n\r\n```sh\r\ntail -f ~/logs/*.log | pjs -t debug-log\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/danielstjules/pjs/issues/comments/70674628","html_url":"https://github.com/danielstjules/pjs/issues/3#issuecomment-70674628","issue_url":"https://api.github.com/repos/danielstjules/pjs/issues/3","id":70674628,"user":{"login":"danielstjules","id":817212,"avatar_url":"https://avatars.githubusercontent.com/u/817212?v=3","gravatar_id":"","url":"https://api.github.com/users/danielstjules","html_url":"https://github.com/danielstjules","followers_url":"https://api.github.com/users/danielstjules/followers","following_url":"https://api.github.com/users/danielstjules/following{/other_user}","gists_url":"https://api.github.com/users/danielstjules/gists{/gist_id}","starred_url":"https://api.github.com/users/danielstjules/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielstjules/subscriptions","organizations_url":"https://api.github.com/users/danielstjules/orgs","repos_url":"https://api.github.com/users/danielstjules/repos","events_url":"https://api.github.com/users/danielstjules/events{/privacy}","received_events_url":"https://api.github.com/users/danielstjules/received_events","type":"User","site_admin":false},"created_at":"2015-01-20T15:45:47Z","updated_at":"2015-01-20T15:45:47Z","body":"Interesting idea! Do you think there's major benefits over just letting people define their own alias?\r\n\r\n``` bash\r\nalias debug=\"pjs -e -f \\\"!!~$.indexOf('DEBUG')\\\" -m '\\\"Found debug entry: \\\" + $'\"\r\n```"}}