/** * Module that provides means to check/search in {@link http://www.jsdelivr.com/ jsDelivr}. * * @module jsdelivr */ "use strict"; var mixing = require("mixing"), cdn = require("./index"); /** * Check whether package with the specified name is existent, or make search for the specified string. * * Data about found packages will be passed into callback as array. * If no package is found, empty array will be passed into callback. * * @param {String} name * Name of the package to check or string to search for. * @param {Function} callback * Function that should be called to process operation's result. * @param {Object} [settings] * Operation settings. * The following settings are supported (name - type - description): <ul> <li><code>caseSensitive</code> - <code>Boolean</code> - Whether case-sensitive check/search should be used <li><code>partialMatch</code> - <code>Integer</code> - Allow partial matching when checking name: 0 - disallow (by default), 1 - allow at the beginning of matching strings, 2 - allow substring matching <li><code>search</code> - <code>Boolean</code> - Whether search should be made instead of check <li><code>limit</code> - <code>Integer</code> - Limit of quantity of results </ul> */ exports.detect = function(name, callback, settings) { cdn.detect(name, callback, mixing({cdn: "jsdelivr"}, settings)); };