Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Seamless client side mocking
| Date | Stars |
|---|---|
| 2026-07-24 | 394 |
| 2026-07-25 | 394 |
| 2026-07-28 | 394 |
| 2026-07-30 | 394 |
| 2026-08-06 | 394 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
Mimic
==========
[](https://travis-ci.org/morsdyce/mimic)
[](https://badge.fury.io/js/mimic)
[](https://snyk.io/test/github/morsdyce/mimic)
Seamless client side mocking [https://mimic.js.org](https://mimic.js.org)

### What is mimic?
Mimic is a tool for mocking server responses on the client side.
Using Mimic in your project
--------------------------
Add to your packages:
npm install mimic --save-dev
Import in your app:
import 'mimic';
Once you reload the application, the Mimic logo will appear in bottom
right corner.
Enjoy!
Loading Mimic only in development environments
--------------------------
To load mimic only in development environments your application will need to be aware if it runs in development or production mode.
If you are using webpack the most common way is to use the DefinePlugin to define NODE_ENV environment variable.
Please see [webpack DefinePlugin](https://webpack.js.org/plugins/define-plugin/) for more information.
If you are using create react app this is applied by default which you can read more about it [here](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#adding-custom-environment-variables).
Once your application is aware of the environment you need to add a conditional require or import statement to load Mimic.
For example:
```js
if (process.env.NODE_ENV === 'development') {
require('mimic');
}
```
Or using the dynamic import spec (you must have babel and [babel-plugin-syntax-dynamic-import](https://babeljs.io/docs/plugins/syntax-dynamic-import/) installed to use this syntax).
```js
if (process.env.NODE_ENV === 'development') {
import('mimic');
}
```
Using Mocks tracked by git
--------------------------
If you want to use mocks which will be committed into git and you're using webpack you can use the following code to import the mocks on application start:
```
import mimic from 'mimic';
const mocks = require.context(__dirname + '/mocks', true, /\.json$/);
mocks.keys().forEach((key) => mimic.import(JSON.stringify(mocks(key))));
```
This assumes your mocks are placed in the mocks directory which is located at the root of the project.
In the mocks directory you have exports for either complete scenarios or separate mock requests.
Guides
-------------
* [Using mimic with React Native](https://github.com/500tech/mimic/blob/master/docs/react-native.md)
* [Using mimic with NativeScript](https://github.com/500tech/mimic/blob/master/docs/nativescript.md)
Other Usages
------------
The main and the most obvious use case for mimic is when the API for a UI feature is not ready or incomplete,
but it can be helpful in more situations. For example:
* You have a demo of the product, but the API server is unstable or you need to use fake data.
* You want to work on a feature outside of company's VPN
* You need access to API, but don't have an internet connection or it is unstable.
In the cases above, you can use the "recording" feature to record all the real responses from server
by hand and then use them for your needs in the future.
Contributing to Mimic
--------------------
1. Clone the repo
1. Install dependencies (at the root of the repo):
```
npm install
```
1. Run the project
```
npm start
```
1. Build for deployment
```
npm run build
```
1. Please submit PRs to the `next` branch, as we keep master as the latest version of mimic.
Acknowledgements
-------
Thanks [Ilya Birman](http://ilyabirman.net) for the new UI for Mimic 2.0
License
-------
The MIT License (MIT)
Copyright (c) 2015 Maayan Glikser
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and aExcerpt of 4,924 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:1f84b99081b47501, topic:testing