Skip to content

Commit

Permalink
feat(scoped): implement scoped package
Browse files Browse the repository at this point in the history
  • Loading branch information
sanemat committed Jul 21, 2015
1 parent a7f6c60 commit 76c8896
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
'use strict';
module.exports = function (str, opts) {
if (typeof str !== 'string') {
throw new TypeError('Expected a string');
}

opts = opts || {};
var isPackage = require('is-package');
var npa = require('npm-package-arg');

return str + ' & ' + (opts.postfix || 'rainbows');
module.exports = function (name) {
var bool;
try {
bool = isPackage(name) && (npa(name)['scope']);
} catch (e) {
bool = false;
}
return bool;
};

0 comments on commit 76c8896

Please sign in to comment.