{"action":"created","issue":{"url":"https://api.github.com/repos/joliss/node-quick-temp/issues/6","labels_url":"https://api.github.com/repos/joliss/node-quick-temp/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/joliss/node-quick-temp/issues/6/comments","events_url":"https://api.github.com/repos/joliss/node-quick-temp/issues/6/events","html_url":"https://github.com/joliss/node-quick-temp/issues/6","id":79102909,"number":6,"title":"Alternative to constructor name","user":{"login":"caitp","id":2294695,"avatar_url":"https://avatars.githubusercontent.com/u/2294695?v=3","gravatar_id":"","url":"https://api.github.com/users/caitp","html_url":"https://github.com/caitp","followers_url":"https://api.github.com/users/caitp/followers","following_url":"https://api.github.com/users/caitp/following{/other_user}","gists_url":"https://api.github.com/users/caitp/gists{/gist_id}","starred_url":"https://api.github.com/users/caitp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caitp/subscriptions","organizations_url":"https://api.github.com/users/caitp/orgs","repos_url":"https://api.github.com/users/caitp/repos","events_url":"https://api.github.com/users/caitp/events{/privacy}","received_events_url":"https://api.github.com/users/caitp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-21T18:03:49Z","updated_at":"2015-05-24T12:59:04Z","closed_at":null,"body":"We're creating wrapped plugins to support incremental builds in angular2, and quick-temp produces very poor names for these.\r\n\r\nIn ES6, Function.prototype.name is explicitly configurable per section 9.2.11 --- but in legacy engines (including old V8) this is not necessarily true. So, the temp directory name always looks like `diffing_plugin_wrapper` --- which is not super ideal, and will throw if we try to configure it unless we use a super bleeding edge version of V8/io.js.\r\n\r\nAs an alternative, it would be really great if there was an optional other way to do this.\r\n\r\nI'm picturing something like this:\r\n\r\n```js\r\nclass DiffingPluginWrapper {\r\n  get pluginName() { return this.pluginClass.name; }\r\n  // ...\r\n}\r\n```\r\n\r\n```js\r\nfunction prettyTmpDirName (obj, prop) {\r\n  function cleanString (s) {\r\n    return underscoreString.underscored(s || '')\r\n      .replace(/[^a-z_]/g, '')\r\n      .replace(/^_+/, '')\r\n  }\r\n\r\n  var cleanObjectName = (typeof obj.pluginName === 'string'\r\n      ? obj.pluginName\r\n      : (obj.constructor && obj.constructor.name)) || '';\r\n  if (cleanObjectName) cleanObjectName += '-'\r\n  var cleanPropertyName = cleanString(prop)\r\n  return cleanObjectName + cleanPropertyName + '-XXXXXXXX.tmp'\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/joliss/node-quick-temp/issues/comments/105013760","html_url":"https://github.com/joliss/node-quick-temp/issues/6#issuecomment-105013760","issue_url":"https://api.github.com/repos/joliss/node-quick-temp/issues/6","id":105013760,"user":{"login":"joliss","id":524783,"avatar_url":"https://avatars.githubusercontent.com/u/524783?v=3","gravatar_id":"","url":"https://api.github.com/users/joliss","html_url":"https://github.com/joliss","followers_url":"https://api.github.com/users/joliss/followers","following_url":"https://api.github.com/users/joliss/following{/other_user}","gists_url":"https://api.github.com/users/joliss/gists{/gist_id}","starred_url":"https://api.github.com/users/joliss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joliss/subscriptions","organizations_url":"https://api.github.com/users/joliss/orgs","repos_url":"https://api.github.com/users/joliss/repos","events_url":"https://api.github.com/users/joliss/events{/privacy}","received_events_url":"https://api.github.com/users/joliss/received_events","type":"User","site_admin":false},"created_at":"2015-05-24T12:59:04Z","updated_at":"2015-05-24T12:59:04Z","body":"(Discussion in #7.)"}}