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

cap-js-mockdata

v0.0.3

Published

SAP CAP plugin to generate mock data.

Downloads

1,513

Readme

SAP CAP Mockdata Plugin

npm test

A SAP CAP plugin to generate CSV files populated with mock data for testing.

This plugin uses Faker to generate meaningful mock data both automatically and through annotations.

Setup

All you need to do is to install the plugin and add the @Mockdata annotations to your entities.

Installation

Install the plugin as an npm module:

npm i -D cap-js-mockdata

Annotation

The annotation tag is @Mockdata. You can add and combine all valid Faker module APIs.

// db/schema.cds

entity Customers : cuid, managed {
  name       String  @Mockdata: {person: 'fullName'};
  sex        String  @Mockdata: {person: 'sex'};
  creditCard String  @Mockdata: {finance: 'creditCardNumber'};
  phone      String  @Mockdata: {phone: 'number'};
  ipAddress  String  @Mockdata: {internet: 'ipv4'};
  email      String  @Mockdata: {internet: 'email'};
  street     String  @Mockdata: {location: 'streetAddress'};
  country    String  @Mockdata: {location: 'countryCode'};
};

Using

Once you have installed the plugin and added the annotations, or not, you can execute the following command in a terminal:

cds add mockdata

The cds add mockdata command will create CSV files for every supported CDS Entity. The CSV files will be created into the db/data folder, the filenames will be something like namespace-entityName.csv and their content will look like:

|ID |createdAt |createdBy |modifiedAt |modifiedBy |name |sex |creditCard |phone |ipAddress |email |street |country | |------------------------------------|----------------------------------------------------------|---------------|----------------------------------------------------------|-----------------------|------------------|------|------------------------|-------------------|---------------|-----------------------------|-------------------|-----------------------| |bef3c7b8-1232-4860-bded-efd51443e508|Sun Oct 06 2024 15:55:24 GMT-0300 (Brasilia Standard Time)|Julius_Hintz48 |Sun Nov 03 2024 14:38:56 GMT-0300 (Brasilia Standard Time)|Brain_Mosciski |Edgar Langosh |female|3564-4519-0923-7387 |801.226.6645 x01258|214.155.102.159|[email protected]|640 Bramley Close |Austria | |96ac7211-691a-4c2a-8fc0-0ae509693193|Thu Mar 28 2024 20:32:35 GMT-0300 (Brasilia Standard Time)|Clotilde_DAmore|Thu Nov 23 2023 10:49:44 GMT-0300 (Brasilia Standard Time)|Brendan.Corwin-Schinner|Erica McDermott |male |6567-6280-8822-5389-0611|(240) 938-1223 |37.230.118.100 |[email protected] |1803 Feeney Park |Cocos (Keeling) Islands| |4fc525bc-e22b-4c55-a447-0e4c9fef1ffd|Fri Feb 09 2024 15:21:45 GMT-0300 (Brasilia Standard Time)|Lance78 |Fri Feb 14 2025 05:25:29 GMT-0300 (Brasilia Standard Time)|Donny_Blanda |Joseph Lehner |male |4686210527760 |312-939-7109 |14.207.231.127 |[email protected]|79422 Collin Divide|Portugal | |872b47a8-0bb1-47af-bc02-ef7290cff633|Sat Feb 22 2025 01:34:16 GMT-0300 (Brasilia Standard Time)|Mateo22 |Sun Sep 15 2024 18:42:41 GMT-0300 (Brasilia Standard Time)|Myrtle52 |Leigh Wintheiser I|male |6759-2563-9161-5976 |553.277.9724 x231 |10.88.166.234 |[email protected] |139 Park Drive |Macao |