Socket
Socket
Sign inDemoInstall

devlist

Package Overview
Dependencies
8
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    devlist

Official Dev List library for interacting with the Dev List API


Version published
Maintainers
1
Install size
531 kB
Created

Readme

Source

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)

Keywords

FAQs

Last updated on 12 Dec 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc