vkfriends-node
Install
npm install --save vkfriends-node
Usage
import {
getUserId, getUserFriends, getUserPhotos,
getUsersNames, getUsersFriends, getUsersPhotos,
userID, userFriends, Photo, User, userPhotos
} from 'vkfriends-node';
getUserId(access_token,"somenamenearuserurlvk")
.then(
(user_id : userID) => {
console.log(user_id)
getUserFriends(token.access_token, user_id)
.then(
(friends:userFriends) => {
console.log(friends)
getUsersNames(token.access_token,friends.userFriendsIDs)
.then(
(users : User[]) => {
console.log(users)
}
);
getUsersFriends(token.access_token,friends.userFriendsIDs)
.then(
(friends : userFriends[]) => {
console.log(friends)
}
)});
}
);
Available methods:
getUserId : (token : string, name : string) : Promise<userID>
getUserFriends : (token : string, user_id : number) : Promise<userFriends>
getUserPhotos : (token : string, user_id : number, count : number) : Promise<Photo[]>
getUsersNames : (access_token:string,ids:number[]) : Promise<User[]>
getUsersFriends : (access_token:string,ids:number[]) : Promise<userFriends[]>
getUsersPhotos : (access_token:string,ids:number[], count:number) : Promise<userPhotos[]>
License
MIT