urban-dictionary-client
Version:
Node JS Client for the Urban Dictionary API
39 lines (30 loc) • 1.32 kB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('axios')) :
typeof define === 'function' && define.amd ? define(['exports', 'axios'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['urban-dictionary-client'] = {}, global.axios));
}(this, (function (exports, axios) { 'use strict';
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
var API_BASE_PATH = 'https://api.urbandictionary.com';
var autocompleteExtra = function autocompleteExtra(term) {
return axios__default['default'].get("".concat(API_BASE_PATH, "/v0/autocomplete-extra"), {
params: {
term: term
}
}).then(function (response) {
return response.data;
});
};
var search = function search(term) {
return axios__default['default'].get("".concat(API_BASE_PATH, "/v0/define"), {
params: {
term: term
}
}).then(function (response) {
return response.data;
});
};
exports.autocompleteExtra = autocompleteExtra;
exports.search = search;
Object.defineProperty(exports, '__esModule', { value: true });
})));