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

wakanda-client

v3.1.6

Published

Wakanda Client allows you to easily interact with Wakanda Server on a JavaScript (browser or node) environment

Downloads

9

Readme

Wakanda Javascript Client

Build Status codecov.io

Minimalist, framework agnostic, JavaScript client to interact with Wakanda Server REST API that exposes a standard and easy to use JavaScript API.

Install

Install through npm or bower. There is only browser version on bower, both node and browser ones on npm.

npm install wakanda-client
#or
bower install wakanda-client

Documentation

Check out the documentation to learn how to use Wakanda-Client.

Development

Git clone this repository then install dependencies. Wakanda Client needs Node 4.0 or greater.

npm install

Run (on web browser)

Launch webpack build on watch mode, it will rebuild the client when sources are edited.

npm run webpack-watch

On another tab, launch a server that serve example application on app/ directory.

npm run serve:proxy

Then open your browser on http://localhost:1136/app/index.html.

Build (dev)

npm run webpack-build

Bundles are built on ./dist/ directory.

You can require wakanda-client.node.js on a Node application, or directly insert wakanda-client.js on a <script> tag (it's a UMD module) and use WakandaClient object.

Integration tests

Integration testing is made with mocha and chai. It directly runs tests against built bundles. Tests are written in ES5 to avoid useless compilation. There are two modes : one which runs tests against node bundle, the other against the umd module on PhantomJS with karma.

There also are commands to launch test without rebuilding the bundles.

#Build and run integration test for karma
npm run test:karma:full

#Run test for karma
npm run test:karma:single

#Build and run integration test for node
npm run test:node:full

#Run test for node
npm run test:node:single

There is a prism-connect server running to mock a real Wakanda Server. It has JSON mocks stored on test/connect/mocks/rest. These JSON can be generated by launching npm run test-server:init. It will launch prism-connect server and proxy all requests to a real Wakanda Server, then store the results. This operation must be do each time tests are modified or added.

You can launch the mocking server by typing npm run test-server:start and stop it with npm run test-server:stop.

Integration tests need this server to be running to execute.

You can use the two following scripts to run both Karma and node unit test with test server launching and stopping alone. Just be sure that port 3000 is free.

#Run test server, build bundles and launch karma and node integration tests
npm run test

#Same as previous one but without building bundles
npm run test-single

Karma automatically proxies requests on /rest to test server. For node test, WakandaClient module is instancied with test server address on each test file.

If port 3000 doesn't suit your needs, you can change it on test/connect/server.js and on test/server.integration.json.

As PhantomJS doesn't support CustomEvent constructor, there is a polyfill on test directory.

License

MIT