Socket
Socket
Sign inDemoInstall

json-server

Package Overview
Dependencies
Maintainers
1
Versions
154
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-server - npm Package Compare versions

Comparing version 0.8.19 to 0.8.20

5

CHANGELOG.md
# Change Log
## [0.8.20][2016-09-12]
* Fix [#355](https://github.com/typicode/json-server/issues/355)
* Add `_page` support
## [0.8.19][2016-08-18]

@@ -4,0 +9,0 @@

2

package.json
{
"name": "json-server",
"version": "0.8.19",
"version": "0.8.20",
"description": "Serves JSON files through REST routes.",

@@ -5,0 +5,0 @@ "main": "./src/server/index.js",

@@ -88,12 +88,12 @@ # JSON Server [![](https://travis-ci.org/typicode/json-server.svg)](https://travis-ci.org/typicode/json-server) [![](https://badge.fury.io/js/json-server.svg)](http://badge.fury.io/js/json-server) [![](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/typicode/json-server?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

### Slice
### Paginate
Add `_start` and `_end` or `_limit` (an `X-Total-Count` header is included in the response)
Add `_page` and in the `Link` header you'll get `first`, `prev`, `next` and `last` links
```
GET /posts?_start=20&_end=30
GET /posts/1/comments?_start=20&_end=30
GET /posts/1/comments?_start=20&_limit=10
GET /posts?_page=7
```
_10 items are returned by default_
### Sort

@@ -108,2 +108,12 @@

### Slice
Add `_start` and `_end` or `_limit` (an `X-Total-Count` header is included in the response)
```
GET /posts?_start=20&_end=30
GET /posts/1/comments?_start=20&_end=30
GET /posts/1/comments?_start=20&_limit=10
```
### Operators

@@ -110,0 +120,0 @@

@@ -171,3 +171,3 @@ var fs = require('fs')

.on('change', function (file) {
if (file === source) {
if (path.resolve(file) === path.resolve(source)) {
if (is.JSON(file)) {

@@ -174,0 +174,0 @@ var obj = JSON.parse(fs.readFileSync(file))

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc