1.2.2 • Published 2 years ago

devlist v1.2.2

Weekly downloads
171
License
MIT
Repository
github
Last release
2 years ago

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

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)

1.2.2

2 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago