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 🙏

© 2026 – Pkg Stats / Ryan Hefner

ya-done-api

v1.0.1

Published

A BDD based framework to automate APIs

Readme

ya-done-api

A BDD based API automation framework based on JAVASCRIPT

Build Status

npm  i  ya-done-api --save

The aim of this Package is to help QA teams to automate API's using Javascript. Ya-done-api comes with predefined method for REST API calls.

How to use the Package for automating- Please follow the below Steps.

There are two structures mentioned below. Sample Projects for both the structures are available for download in GITHUB. (To Skip the Reading 😉)

1. Decide Your Directry Structure: Sample Folder Structure 1

features
    ├─sampleFeature.js
steps
    ├─lib
    |   ├─all-steps.js 
    ├─index.js
index.js
package.json

2. write the feature File

Feature: Sample Feature to Test the package

Scenario: 
  Given Get random postcode

3. Write the code for the step

./steps/lib/all-steps.js

import { utils } from 'ya-done-api';
const addContext = require('mochawesome/addContext');
import expect from 'expect';

export default function () {
    return (
      this
        .given(
          'Get random postcode',
          async function getRandomAddressBygeneratingPostcode() {
            const path = `https://api.postcodes.io/random/postcodes`;
            const header = { 'Content-Type': 'application/json' }
            const response = await utils.GET(header, path);
            expect(response.status).toEqual(200);
            addContext(this.mocha,
              `Random generated postcode : ${response.data.result.postcode}
            `);
          }
        )
    );
  }

4. Extract the code to pass it Ya-done-api framework for execution

./steps/index.js

import {yaddaLibrary} from 'ya-done-api';
import _allSteps from './lib/all-steps';

const bootstrap = () => {
    return _allSteps.call(yaddaLibrary());
};
  
export default bootstrap();

5. Pass the requried steps in main index File

./index.js

import {yaddaCore, countScenarios} from 'ya-done-api';
import steps from './steps';

//Set the Framework for stepLevel Execution 
const framework = { stepLevel: true } // This is a feture to show the steps wise progess in terminal, completely optional

//running the test cases using Yadda
yaddaCore(steps, framework);

6. install and run the project 🥳

npm  i
npm  test

If you want to split the Given when then in steps, you can follow the below structure: Structure 2

features
    ├─sampleFeature.js
steps
    ├─given
    |    ├─lib
    |    |   ├─givenSteps.js
    |    ├─index.js
    ├─when
    |    ├─lib
    |    |   ├─whenSteps.js
    |    ├─index.js
    ├─then
    |    ├─lib
    |    |   ├─thenSteps.js
    |    ├─index.js
    ├─index.js
index.js
package.json

Adding a dictionary

Dictionaries have been abstracted for simple use in ya-done. Dictionaries allow the use of tables and variables within steps.

how to consume reading scenario count from feature files

In local index.js:

  • import the count scenarios function -->
import {countScenarios} from 'ya-done-api';
  • countScenarios(filePath) (Where file path is where your feature files are stored)

we have written most used REST API methods for reuse, please find below the functions available.

  • GET
  • POST
  • PUT
  • PATCH
  • DELETE
  • HEAD
  • OPTIONS
  • wait

how to consume the common REST API Methods

  • import the utils from ya-done
import { utils } from 'ya-done-api';
await utils.GET(header, path); //please refer to the step3 for detailed example
Please share your feedback!!!
Thanks!! 🤝