devlist

1.2.2 • Public • Published

Dev List

Dev List NPM Package Statistics
  • 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

Read Documentation

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)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.2.2
    1
    • latest

Version History

Package Sidebar

Install

npm i devlist

Weekly Downloads

2

Version

1.2.2

License

MIT

Unpacked Size

11.3 kB

Total Files

14

Last publish

Collaborators

  • tariqdev