npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dailymotion-sdk

v0.1.13

Published

Node.js SDK for Dailymotion API

Downloads

94

Readme

dailymotion-sdk-node

Node.js SDK for Dailymotion API

Examples

Refer to the examples folder to get a setup example

API


setScope(scope)

Sets access scope

Parameters

scope: array | function | string, Permission scopes. Can be array, function or string (separated by spaces)

setCredentials(grant_type, credentials)

Sets credentials

Parameters

grant_type: string, Can be either 'client_credentials', 'authorization_code' or 'password'

credentials: object, Credentials in the following structure

objectpassword:

  • string username
  • string password

object authorization_code:

  • string access_token
  • string refresh_token

OR

  • string redirect_uri
  • string code

object client_credentials: leave it empty

createToken(next)

Creates a token when you have 'password' grant type

Parameters

next: function, Callback for when the token is indeed refreshed. Can be called with 1 param if error

refreshToken(next)

Refreshes an expired access_token with the help of a refresh_token

Parameters

next: function, Callback for when the token is indeed refreshed. Can be called with 1 param if error

api(verb, endpoint, data, callback)

Authenticated API Request

data and callback arguments are swappable.

Parameters

verb: string, HTTP Verb to be used

endpoint: string, Endpoint path

data: object, Data to send to given endpoint

callback: function, Function called when request is done. Callback params are:

  • Error err - It should be null most of the time
  • Request r - Request object for better control
  • Object res - Parsed response body

The following methods are used to facilitate api calls

get(enpoint, data, callback)

post(enpoint, data, callback)

put(enpoint, data, callback)

delete(enpoint, data, callback)

patch(enpoint, callback)

head(enpoint, callback)


upload(options)

Uploads a video using user's auth data

Parameters

options: object, Contains the following fields :

  • string filepath - System path to video
  • object meta - Metadata for the new video (such as title, channel, tags, etc)
  • OPTIONAL function progress - Progress callback for upload progression
  • OPTIONAL function done - Called when upload is finished with new video ID and other data.

Bitdeli Badge