eduardoboucas / eduardoboucas/static-api-generator

Add warning / error when something else than YAML is passed

Open
#4 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
148
Forks
10
PR merge metrics
No merged PRs in 30d

Description

I wanted to try the generator API so I installed it: `npm i static-api-generator`

I created a generator for my JSON data:

```javascript
const API = require('static-api-generator');
const api = new API({
addIdToFiles: true,
blueprint: 'data/:page/:category',
outputPath: 'temp/api/',
pluralise: false
});
api.generate({
endpoints: ['page', 'category']
});
```

then run it: `node script.js`.

And the result is that I have one char per entry:

![](https://i.imgur.com/SG9zeMd.png)

And if I put `addIdToFiles` to `false` I have the whole content as one string

![](http://i.imgur.com/GNwtoFB.png)

So it's like newline terminator are not properly detected.

I'm running it under archlinux with LN (`\n`) as final newline and utf-8 as charset. And I'm using node v10.0.0. All data files are JSON.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.