Suppose in an ember-cli app I want to reuse a simple utility function in multiple places. For example a function for packing an array of strings into a csv string:
var pack = function(arr) {
return arr.filter(this, function() {return value != null} ).join(",");
}
Don’t dwell on the code too much, the point is I’m sure it’s lightweight, stateless and not Ember specific. But I do want to use it from multiple ember-cli modules.
What’s the cleanest strategy for housing this kind of simple utility function in an ember-cli project? Create a lib folder in my project and house it somewhere in there and import it into the ember part with namespacing maybe?
Apologies for the niavety, I’m relatively inexperienced with node style development. Also I’ve refrained from asking on Stack Overflow as the answer would depend on opinion.