Skip to content

Commit 79d9b86

Browse files
authored
Remove fs-extra (#193)
1 parent a14c188 commit 79d9b86

File tree

4 files changed

+8
-40
lines changed

4 files changed

+8
-40
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ npm i --save-dev @manifoldco/swagger-to-ts
6767
```
6868

6969
```js
70-
const { readFileSync } = require('fs');
71-
const swaggerToTS = require('@manifoldco/swagger-to-ts');
70+
const { readFileSync } = require("fs");
71+
const swaggerToTS = require("@manifoldco/swagger-to-ts");
7272

73-
const input = JSON.parse(readFileSync('spec.json', 'utf8')); // Input can be any JS object (OpenAPI format)
73+
const input = JSON.parse(readFileSync("spec.json", "utf8")); // Input can be any JS object (OpenAPI format)
7474
const output = swaggerToTS(input); // Outputs TypeScript defs as a string (to be parsed, or written to a file)
7575
```
7676

@@ -94,8 +94,8 @@ An example on how to use the `x-nullable` property to control if a property is o
9494

9595
```js
9696
const getNullable = (d: { [key: string]: any }): boolean => {
97-
const nullable = d['x-nullable'];
98-
if (typeof nullable === 'boolean') {
97+
const nullable = d["x-nullable"];
98+
if (typeof nullable === "boolean") {
9999
return nullable;
100100
}
101101
return true;

bin/cli.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22

3-
const fs = require("fs-extra");
3+
const fs = require("fs");
44
const chalk = require("chalk");
55
const path = require("path");
66
const meow = require("meow");
@@ -45,8 +45,6 @@ const timeStart = process.hrtime();
4545
// Write to file if specifying output
4646
if (cli.flags.output) {
4747
const outputFile = path.resolve(process.cwd(), cli.flags.output);
48-
const parent = path.dirname(outputFile);
49-
fs.mkdirpSync(parent);
5048
fs.writeFileSync(outputFile, result, "utf8");
5149

5250
const timeEnd = process.hrtime(timeStart);

package-lock.json

Lines changed: 2 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
},
6262
"dependencies": {
6363
"chalk": "^4.0.0",
64-
"fs-extra": "^9.0.0",
6564
"js-yaml": "^3.13.1",
6665
"meow": "^6.1.0",
6766
"prettier": "^2.0.4"

0 commit comments

Comments
 (0)