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

@junte/mocker-library

v0.0.59

Published

Library for creating mock files for your projects.

Readme

MockerLibrary

Library for creating mock files for your projects.

After setting up and running the library, it will automatically create the HBS(DummyJSON) files from which the conversion to JSON will occur. ##Getting started ####1. Add a dependency to your package.json:

npm install @junte/mocker-library

####2. Add a script in your package.json:

"scripts": {
   ...
  "mocks": "gulp build --gulpfile node_modules/@junte/mocker-library/gulpfile.js --cwd ."
   ...
}

####3. Change a tsconfig.json:

{
    ...
    compilerOptions: {
        ...
        emitDecoratorMetadata: true,
        ...
    },
    ...
}

####4. Config After the first run mocks script, a config file (mocker.json) will be created in root directory. Set your preferences for the library.

Default config values:

{
  outDirProject: './dist/out-tsc',
  modelsDir: './src/models',
  helpersDir: './src/mocks/helpers',
  objectsDir: './src/mocks/objects',
  servicesDir: './src/mocks/services',
  outObjectsJsonDir: './src/mocks/objects',
  outServicesJsonDir: './src/assets/mocks'
}

outDirProject - this equal to the outDir your project (see tsconfig.json)

modelsDir - directory in which the data models with decorators are placed in them

helpersDir - directory with helpers (for dummyjson)

objectsDir - directory in which the script will add *.hbs (for dummyjson) files generated from models

servicesDir - directory in which you will create *.hbs files for services

outObjectsJsonDir - directory in which json files created from *.hbs files which are in objectsDir

outServicesJsonDir - directory in which json files created from *.hbs files which are in servicesDir

#Examples Model ObjectLink.ts:

@model()
export class ObjectLink {

  @field({mock: '{{int 1 100}}'})
  id: number;

  @field({mock: '{{presentation}}'})
  presentation: string;
  
}

Model User.ts:

@model()
export class User {

  @field({mock: '{{int 1 100}}'})
  id: number;

  @field({mock: '{{boolean}}'})
  approved: boolean;

  @field({mock: '{{> object_link presentation="John"}}'})
  name: ObjectLink;

  @field({
    name: 'first_name',
    mock: '{{firstName}}'
  })
  firstName: string;

  @field({
    serializer: new ArraySerializer(new ModelSerializer(ObjectLink)),
    mock: '[{{#repeat 1 5}} {{> object_link presentation="Hobby"}} {{/repeat}}]'
  })
  hobby: ObjectLink[];

}

at the output we get object_link.json:

{
    "id": 77,
    "presentation": "John"
}

and user.json:

{
    "id": 47,
    "approved": false,
    "name": {
        "id": 76,
        "presentation": "John"
    },
    "first_name": "Darrell",
    "hobby": [
        {
            "id": 71,
            "presentation": "Hobby"
        },
        {
            "id": 4,
            "presentation": "Hobby"
        },
        {
            "id": 63,
            "presentation": "Hobby"
        }
      ...
    ]
}