Package Exports
- devlist
- devlist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (devlist) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Dev List
- NPM package that gets information about devlist profile and other info from the Dev List API
- Useful for websites & bots where users can input any profile id/slug
- Supports the Promise-API, you will be able to use .then, .catch, etc...
Check out our documentation Dev List.
Installation from NPM
npm i devlist
Usage
Examples
(Using Await)
const dlist = require('devlist');
const dlist_api = new dlist.API_Controller();
async function getUserData(){
let user = await dlist_api.profile('300530315351425024');
console.log(user); // profile object
let user = await dlist_api.exists('300530315351425024');
console.log(user); // true
let slug = await dlist_api.slug('tariq');
console.log(slug); // 300530315351425024
let widget = await dlist_api.widget('300530315351425024');
console.log(widget); // widget object
}
getUserData(); // calling the function(Using .then function)
const dlist = require('devlist');
const dlist_api = new dlist.API_Controller();
dlist_api.profile('300530315351425024').then(user => {
console.log(user);
})
dlist_api.exists('300530315351425024').then(exists => {
console.log(exists);
})
dlist_api.slug('tariq').then(slug => {
console.log(slug);
})
dlist_api.widget('300530315351425024').then(widget => {
console.log(widget);
})(Validation)
const dlist = require('devlist');
const dlist_api = new dlist.API_Controller();
dlist_api.profile('300530315351425024').then(user => {
if(user){
console.log(user); // user found
}else{
console.log("User not found");
}
})
dlist_api.exists('300530315351425024').then(exists => {
if(exists){
console.log("Profile exists");
}else{
console.log("Profile does not exists");
}
})
dlist_api.slug('tariq').then(slug => {
if(slug){
console.log("slug is taken by: " + slug);
}else{
console.log("slug is available")
}
})
dlist_api.widget('300530315351425024').then(widget => {
if(widget){
console.log(widget);
// {"buffer":BUFFER,"link":"https://dlist.dev/api/profile/300530315351425024/widget.png"}
}else{
console.log("Profile was not found");
}
})Contributing
© Dev List, 2021 | TARIQ (contact@itariq.dev)