Skip to content

Commit

Permalink
refactor: rename package to @shujau/mockingjs
Browse files Browse the repository at this point in the history
  • Loading branch information
asadhshujau committed Jan 28, 2025
1 parent 614fe8b commit cea9f20
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# shujau-mock-factory
# @shujau/mockingjs

![CI](https://github.com/asadhshujau/mock-factory/workflows/CI/badge.svg)
[![npm version](https://badge.fury.io/js/shujau-mock-factory.svg)](https://badge.fury.io/js/shujau-mock-factory)
![CI](https://github.com/asadhshujau/mockingjs/workflows/CI/badge.svg)
[![npm version](https://badge.fury.io/js/@shujau%2Fmockingjs.svg)](https://badge.fury.io/js/@shujau%2Fmockingjs)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A flexible and powerful mock data generator built on top of Faker.js, designed to streamline the creation of realistic test data for your JavaScript applications.
Expand All @@ -21,18 +21,18 @@ A flexible and powerful mock data generator built on top of Faker.js, designed t

Using npm:
```bash
npm install shujau-mock-factory
npm install @shujau/mockingjs
```

Using yarn:
```bash
yarn add shujau-mock-factory
yarn add @shujau/mockingjs
```

## Quick Start

```javascript
import factory from 'shujau-mock-factory';
import factory from '@shujau/mockingjs';

const users = factory({
id: 'uniqueInt',
Expand Down Expand Up @@ -135,7 +135,7 @@ You can set a seed to generate consistent data across multiple runs. This can be
1. Using the `setSeed` function:

```javascript
import { factory, setSeed } from 'shujau-mock-factory';
import { factory, setSeed } from '@shujau/mockingjs';

setSeed(123);
const users = factory({ name: 'fullName', email: 'email' }, { quantity: 2 });
Expand All @@ -144,7 +144,7 @@ const users = factory({ name: 'fullName', email: 'email' }, { quantity: 2 });
2. Using the `seed` option in the `factory` function (recommended):

```javascript
import { factory } from 'shujau-mock-factory';
import { factory } from '@shujau/mockingjs';

const users = factory(
{ name: 'fullName', email: 'email' },
Expand All @@ -159,7 +159,7 @@ Using the `seed` option is recommended as it allows for more localized control o
#### Custom Type Definitions

```javascript
import { factory, defineType } from 'shujau-mock-factory';
import { factory, defineType } from '@shujau/mockingjs';

defineType('customEmail', () => `user_${Math.random().toString(36).substr(2, 5)}@example.com`);

Expand All @@ -172,7 +172,7 @@ const users = factory({
#### Schema Inference from Sample Data

```javascript
import { factory } from 'shujau-mock-factory';
import { factory } from '@shujau/mockingjs';

const sampleUser = {
id: 1,
Expand All @@ -187,7 +187,7 @@ const users = factory(sampleUser, { quantity: 3, isSample: true });
#### Unique Integer Management

```javascript
import { factory, setUniqueIntStart, resetUniqueIntCounter } from 'shujau-mock-factory';
import { factory, setUniqueIntStart, resetUniqueIntCounter } from '@shujau/mockingjs';

setUniqueIntStart(1000);
const users = factory({ id: 'uniqueInt', name: 'fullName' }, { quantity: 2 });
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "shujau-mock-factory",
"name": "@shujau/mockingjs",
"version": "2.0.1",
"description": "A flexible fake data generator based on Faker.js",
"description": "A flexible fake data generator based on Faker.js (formerly shujau-mock-factory)",
"main": "src/index.js",
"type": "module",
"engines": {
"node": ">=14.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/asadhshujau/mock-factory.git"
"url": "git+https://github.com/asadhshujau/mockingjs.git"
},
"files": [
"src/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @module index
* @description Main entry point for the shujau-mock-factory package
* @description Main entry point for the @shujau/mockingjs package
*/

import factory, { defineType, normalizeSchema, setSeed } from './factory.js'
Expand Down

0 comments on commit cea9f20

Please sign in to comment.