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

ez-js-rest-client

v1.5.0

Published

eZ Platform JavaScript REST client

Downloads

7

Readme

JavaScript client for the eZ Platform REST API

Build Status

This repository provides a JavaScript library meant to ease the usage of the eZ Publish REST API.

Installation

The eZ Platform JavaScript REST Client is a bower package, so the easiest way to install it is to run:

$ bower install --save ezsystems/ez-js-rest-client

Then you can include in your project the file bower\_components/ez-js-rest-client/dist/CAPI-min.js (or the non minified version). It's also possible to directly take dist/CAPI.js or dist/CAPI-min.js in a clone of this repository.

Usage

The usage the JavaScript REST Client is detailed in Using the JavaScript REST API Client

Development

Requirements

The project maintenance is handled in a nodejs based environment with a help of Grunt task runner.

  • Install nodejs
  • Clone this repository
  • From the root of the repository, install the local npm dependencies:
    $ npm install
  • Install the global dependencies (usually you need to be root)
    # npm install -g grunt-cli yuidocjs

API Documentation

The JavaScript API documentation can be generated in the api directory with:

$ grunt doc

Alternatively, you can run

$ grunt livedoc

to run the yuidoc documentation server. The dynamic documentation can then be reached at http://127.0.0.1:3000.

Build

The library can be built with:

$ grunt build

This command will (re)generate the files dist/CAPI.js and dist/CAPI-min.js.

Tests

#### Unit tests

The unit tests can be executed with:

$ grunt test

It's also possible to generate a coverage report with:

$ grunt coverage

After this command, the report is available in test/coverage/lcov-report/index.html.

Continuous execution

During development it may be quite handy to automatically rerun unit-tests and/or lint checks, once any project related file has changed.

Using so called watch tasks this can easily be achieved. Currently the following of those tasks exist:

  • watch:lint: On each file change execute a linting run
  • watch:test: Execute a unit-test run on each file change

Manual tests

The library can be manually tested by installing the Symfony2 bundle jsRestClientBundle, which is situated in the test/manual/ folder.

Before bundle installation run grunt build command once. It will build all the source files into Resources/public/js/CAPI.js file.

Then the bundle could be installed into your current ezPublish 5.x instance using following instruction:

  • Create path/to/ezpublish5/src/EzSystems if it does not exist.

  • Symlink the bundle into /src/EzSystems/ (keep folder name).

  • Edit /app/AppKernel.php and add the following line before in the return statement of the method registerBundles:

    $bundles[] = new EzSystems\jsRestClientBundle\jsRestClientBundle();
  • Import routing.yml file of the bundle into main routing file by adding the following lines at the very bottom of ezpublish/config/routing.yml:

    jsRestClientBundle:
        resource: "@jsRestClientBundle/Resources/config/routing.yml"
  • Clear the Symfony 2 caches with app/console.

After these steps you may access /js-rest-client-test/ path where you will find testing html page. Most of requests can be configured a little bit before executing them by changing input values. See details of tests implementation in Resources/public/js/cookbook-*.js files.