You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
- Add set & get example - Use bash script to test doc tests - Add package.json to doctests - Add search-quickstart
33 lines
815 B
Markdown
33 lines
815 B
Markdown
# Command examples for redis.io
|
|
|
|
## Setup
|
|
|
|
To set up the examples folder so that you can run an example / develop one of your own:
|
|
|
|
```
|
|
$ git clone https://github.com/redis/node-redis.git
|
|
$ cd node-redis
|
|
$ npm install -ws && npm run build-all
|
|
$ cd doctests
|
|
$ npm install
|
|
```
|
|
|
|
## How to add examples
|
|
|
|
Create regular node file in the current folder with meaningful name. It makes sense prefix example files with
|
|
command category (e.g. string, set, list, hash, etc) to make navigation in the folder easier.
|
|
|
|
### Special markup
|
|
|
|
See https://github.com/redis-stack/redis-stack-website#readme for more details.
|
|
|
|
## How to test the examples
|
|
|
|
Just include necessary assertions in the example file and run
|
|
```bash
|
|
sh doctests/run_examples.sh
|
|
```
|
|
to test all examples in the current folder.
|
|
|
|
See `tests.js` for more details.
|