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

shredder-sdk

v2.0.0

Published

Shredder development kit complete with mock server

Downloads

42

Readme

shredder-sdk Build Status

shredder Software Development Kit

API Usage

$ npm install shredder-sdk --save
'use strict';
var shredder = require('shredder-sdk')

shredder.api.updateConfig({
  master: {
    host: 'api.shredder.io',
    port: 5980
  }
})

//store the user session
var session = {}

//setup our api and login
var api = shredder.api.master()
api.postAsync({
  url: api.url('/user/login'),
  json: {
    username: 'myusername',
    password: 'mypassword'
  }
})
  .spread(api.validateResponse())
  .spread(function(res,body){
    console.log(body)
    session = body.session
  })
  .catch(api.handleNetworkError)
  .catch(shredder.NetworkError,function(err){
    console.log('A network error occurred: ' + err.message)
  })

Mock Usage

'use strict';
var shredder = require('shredder-sdk')

shredder.api.updateConfig({
  master: {
    port: 5980,
    host: '127.0.0.1'
  }
})

describe('my test',function(){
  before(function(){
    return shredder.mock.start(5980,'127.0.0.1')
  })
  after(function(){
    return shredder.mock.stop()
  })
  it('should be up',function(){
    var api = shredder.api.master()
    return api.postAsync(api.url('/ping'))
      .spread(function(res,body){
        expect(body.pong).to.equal('pong')
      })
  })
})

Changelog

2.0.0

  • Change to operate Couchdb rather than the Shredder master
  • Update dependencies and test across Node 6,8
  • Change from cradle to nano to provide Couchdb access
  • Drop Couchdb mock in favor of using real Couchdb
  • Matches Shredder 2.0.0 release.
  • Update dependencies
  • Update oose-sdk
  • Adjust calls to match oose-sdk changes

1.1.9

  • Fix to get the keygen tool actually working.

1.1.8

  • Fix to make sure keygen gets installed globally.

1.1.7

  • Enable sticky session support.
  • Add helper for generating session keys.
  • Shredder login now takes username and password at call time shredder.login(un,pw)

1.1.6

  • Drop session expiration they are now sticky

1.1.5

  • Upgrade to latest oose-sdk
  • Hard set token key name

1.1.4

  • Fix error where jobContentUrl would give out an http:// URL instead of https

1.1.3

  • Renamed contentExists to jobContentExists
  • Renamed contentUrl to jobContentUrl

1.1.2

  • Added contentExists functionality
  • Added contentUrl helper

1.1.1

  • Fix recursion bug on api config update

1.1.0

  • Upgraded to match new OOSE standards
  • Upgraded to oose-sdk 1.1.0
  • Abstracted MaxConcurrencyError
  • Added Shredder helper
  • Added job mock
  • Completed mock server
  • Completed mock testing
  • Added Shredder testing
  • Added travis builds

1.0.1

  • Use PEM for SSL rather than cert/key

1.0.0

  • Initial Release