Skip to content

Commit

Permalink
feat: add experimental warning
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzafroide committed Nov 7, 2018
1 parent 6ef63d5 commit 2828f6a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/volume.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,8 @@ function validateGid(gid: number) {

// ---------------------------------------- Volume

let promisesWarn = true;

/**
* `Volume` represents a file system.
*/
Expand Down Expand Up @@ -566,6 +568,13 @@ export class Volume {
private promisesApi = createPromisesApi(this);

get promises() {
if (promisesWarn) {
promisesWarn = false;
require('process').emitWarning(
'The fs.promises API is experimental',
'ExperimentalWarning',
);
}
return this.promisesApi;
}

Expand Down

0 comments on commit 2828f6a

Please sign in to comment.