Skip to content

Commit

Permalink
Release v0.4.0 (#84)
Browse files Browse the repository at this point in the history
* remove hard-coded functions names for `promisify` (#9)

* remove hard-coded functions names for `promisify`

* fixing eslint

* fix code style

* add atomics keyword, and bump to v0.1.5

* It requires Node.js 8.1.0 (#10)

* fix npm

npm wouldn't let me fix the pulished version correctly, had to bump package to fix.

* Modualized Refactor and Docs (#12)

* modualise and document

* fix util requires

* fix outputjsonatomic requires

* finish out docs

* generated docs

* Fix travis

* bump version to v0.2.0

* Fix lint

* remove search

the search didn't really work

* cname for js.org

* more docs customization

* More document coverage

* Fix lint

* finish documentation coverage

* Add a Codacy badge to README.md (#13)

* Add Codacy badge

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* update docs

* Create LICENSE

* update dev deps, add tests to travis, unskip all tests

* Some fixes, and a bunch more tests

I am aware builds are going to fail for a while

* Fix one test

* finish tests draft

* fix a couple tests

* fix more tests

* Fix build with test skips

* 3 more skips

* more test work

* remove fixes

* this is probably going to fail build

* maybe fixed 1 test?

* fix move test

* fix some test bugs

* skip symlink tests until I can rewrite to remove fs-mock

* Create .travis-deploy.sh

* Update package.json

* Update .travis.yml

* Update .travis-deploy.sh

* try auto docs

* Update .travis-deploy.sh

* fix .travis-deploy?

* Update .travis-deploy.sh

* Update .travis-deploy.sh

* Update .travis-deploy.sh

* Update .travis-deploy.sh

* Update .travis-deploy.sh

* Update .travis-deploy.sh

* Update .travis-deploy.sh

* Site build: c4a1ec1

* fix docs, from auto docs test

* Site build: b8d9a56

* Update .travis-deploy.sh

* Update .travis-deploy.sh

* Update .travis.yml

* Update .travis-deploy.sh

* add .travis-deploy.sh to npmignore

* update deps

* Docs build: c947062

* Docs build: 01c52e8

* Add Greenkeeper badge 🌴 (#15)

* docs(readme): add Greenkeeper badge

* Update README.md

* Fix travis deploy

* Docs build: 21de27f

* update eslint

* Update README.md

* Docs build: 39e4515

* code cleanup

* Fix typo (#16)

* Docs build: e1f8556

* fix util mkDir

* Docs build: 011f8b7

* Fix copy error

* 0.2.1

* Copy file (#18)

* copyFile changes

* some docs, still very wip

* Update .travis.yml

* mock fs can't handle the new fs.copyFile yet

* emptyDir bugfix

* last bug fix

* Typings. (#19)

* Create tslint.json

* Fixed typos, added typings.

* Fixed all JSDocs

* minor fixes

* fix lint and friends

* missed docs

* le typings

* Docs build: 29fb5da

* update readme

* Docs build: 83dc519

* Coverage (#21)

* start coverage and docs changes

* remove docs from future master

* oops travis

* make codacy happy more tests, still wip

* progress, but mock-fs sucks

* fix scripts

* begin module structure and ditching mock-fs

* add another test to see if somethings wrong...

* oops

* Update Messages, Add test

* tests progress

* push progress

* push progress

* oops

* push progress

* oops

* finish basic tests

* small fixes

* oops

* bug fix

* test fixes

* should fix a lot of symlink bugs?

* maybe fix move tests?

* take 2 move tests

* take 3 move

* fix remove tests

* ahah!

* see how this fares for copy

* idek anymore

* try this on for size

* duh

* fingers crossed

* more copy coverage

* copy coverage

* Update README.md

* More unit tests (#22)

* copy tests

* oh yeah

* symlink copy test

* interesting edge test

* oops

* up threshold

* update npm ignore for prepping patch release

* 0.3.1

* Remove mock-fs since it's not used anymore

* Scan (#24)

* impliment scan idea (klaw without nastiness)

* impliment limit

* umm?

* ohh!

* should do the first directory.

* add filter

* fix limit

* docs

* copy paste OP

* tests

* fix test

* unneeded `async`

* typings I think

* 0.3.2

* Fixed some types (#27)

* Fixed some types

* I guess this is the fix

* chore(package): update ava to version 0.23.0 (#26)

* Add matrix testing support

* Add node 9 testing to coverage

* uh, you skipped 8...

* try again travis

* ?? travis you there?

* update lint

* chore(package): update ava to version 0.25.0 (#28)

* chore(package): update ava to version 0.25.0 (#29)

Closes #28

* fix broken test?

* Fixed typings (#30)

* Fixed typings (hopefully)

Fixed return types for createReadStream and createWriteStream
Imported Buffer to fix a ton of errors

* Fixed a missing property by just importing from fs

I don't remember what I was trying to use, but something was missing
from ReadStream/WriteStream. I just imported it from fs, to ensure
consistency.

* add fs/promises support if your node version is high enough

* bump version and add note to readme

* add node 10 tests to travis

* fix broken test?

* try again?

* bump package.json

* fix some docs

* chore(package): update codacy-coverage to version 3.0.0 (#34)

* more bugged docs

* Update @types/node to the latest version 🚀 (#36)

* chore(package): update @types/node to version 10.0.3

* Update README.md

* fix lint warnings and fix fs.promises use for node ^10.1.0

drop support for node 10.0.0 fs.promises (will fall back to regular util.promisify so not breaking)

* chore(package): update @types/node to version 10.1.3 (#39)

* chore(package): update nyc to version 12.0.1 (#41)

* Update README.md

* Update typescript requirement to ^3.0.1 (#45)

Updates the requirements on [typescript](https://github.com/Microsoft/TypeScript) to permit the latest version.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/commits/v3.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Update eslint requirement to ^5.2.0 (#46)

Updates the requirements on [eslint](https://github.com/eslint/eslint) to permit the latest version.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/commits/v5.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* docs: Improved typings and docs (#43)

* doc: Updated all docs, made typings way better

* fix: fsn#emptyDir (readdir returns string[], mkdirs returns string)

* tslint: Replaced quotes

* eslint: Remove @returns tag for emptyDir

* tslint: Fix typings for fs#write

* return 'file' if lstat errors

* test: Add test for bug kyra found

* bump version for release

* fix alias `writeJsonAtomic` (#49)

* bump version for release

* Update nyc requirement from ^12.0.1 to ^13.0.1 (#51)

Updates the requirements on [nyc](https://github.com/istanbuljs/nyc) to permit the latest version.
- [Release notes](https://github.com/istanbuljs/nyc/releases)
- [Changelog](https://github.com/istanbuljs/nyc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/istanbuljs/nyc/commits/v13.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Update scan.js

* Chore(deps-dev): update ava requirement from ^0.25.0 to ^1.0.1 (#53)

* Chore(deps-dev): update ava requirement from ^0.25.0 to ^1.0.1

Updates the requirements on [ava](https://github.com/avajs/ava) to permit the latest version.
- [Release notes](https://github.com/avajs/ava/releases)
- [Commits](https://github.com/avajs/ava/commits/v1.0.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Update copy.js

* Update scan.js

* Update remove.js

* Update move.js

* use yarn.lock for dependabot, add node 11 tests (#54)

* use yarn.lock for dependabot, add node 11 tests

* actually, no need to test node 9 any longer

* refactor copy to be less complex (#55)

* bump patch for new release

* switch from codacy to coveralls

* better test coverage

* typos

* add another test case

* another test

having trouble hitting the lines I want to...

* more tests

* fix expected assertions

* more tests

* lint

* badge updates

* attempt ignoring all windows specific code

* wrong path ignored

* updated comments

* see if this makes a branch difference

* more clear logic/ comments

* lint

* util coverage comments

* remove duplicate coercion

* refactor then/catch tree into try/catch await

* lint

* docs spelling

* more tests and docs fixes

* maybe fix coverage ignore?

* add appveyor config (#57)

* add appveyor config

* new line endof file

* get linux errors

* breaking: rewrite move

* test fails on both linux/windows, presumed flawed test

* add proper ignores back to the new move

* remove other clobber options

* refactor util

this might reduce coverage

* better isSrcKid

* fix bad refactor

* another copy test

* and another

* another obscure test

* bit of rewrite

* better coverage

* does this change how coverage sees branches?

* ?

* more rewrite

no .then/.catch

* symlink test

* does this get that last symlink branch?

* whoops

* one last obscure test

and hope we don't lock up travis

* fix duplicate title

* correction

dev/null is a character device, not block device :(

* Bump tslint from 5.11.0 to 5.12.0

Bumps [tslint](https://github.com/palantir/tslint) from 5.11.0 to 5.12.0.
- [Release notes](https://github.com/palantir/tslint/releases)
- [Changelog](https://github.com/palantir/tslint/blob/master/CHANGELOG.md)
- [Commits](palantir/tslint@5.11.0...5.12.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump @types/node from 10.12.15 to 10.12.17

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped) from 10.12.15 to 10.12.17.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* coverage

* or actually

* fix superfluous argument

* clobber removed

* make prs report coverage too (#60)

* Bump @types/node from 10.12.17 to 10.12.18

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped) from 10.12.17 to 10.12.18.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump eslint from 5.10.0 to 5.11.0

Bumps [eslint](https://github.com/eslint/eslint) from 5.10.0 to 5.11.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](eslint/eslint@v5.10.0...v5.11.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump eslint from 5.11.0 to 5.11.1

Bumps [eslint](https://github.com/eslint/eslint) from 5.11.0 to 5.11.1.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](eslint/eslint@v5.11.0...v5.11.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* consistent errors

* ensure strict returns and consistency sweep

* fix return type

* fix coverage

* more simplification

* whoops

* remove useless return

* revert change to mkdirs

since that slows recursive calls unnecessarily

* more cleanup and engine bump for object spread

* forgot to hit save

* Bump eslint from 5.11.1 to 5.12.0

Bumps [eslint](https://github.com/eslint/eslint) from 5.11.1 to 5.12.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](eslint/eslint@v5.11.1...v5.12.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump tslint from 5.12.0 to 5.12.1

Bumps [tslint](https://github.com/palantir/tslint) from 5.12.0 to 5.12.1.
- [Release notes](https://github.com/palantir/tslint/releases)
- [Changelog](https://github.com/palantir/tslint/blob/master/CHANGELOG.md)
- [Commits](palantir/tslint@5.12.0...5.12.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump ava from 1.0.1 to 1.1.0

Bumps [ava](https://github.com/avajs/ava) from 1.0.1 to 1.1.0.
- [Release notes](https://github.com/avajs/ava/releases)
- [Commits](avajs/ava@v1.0.1...v1.1.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump typescript from 3.2.2 to 3.2.4

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.2.2 to 3.2.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](microsoft/TypeScript@v3.2.2...v3.2.4)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump eslint from 5.12.0 to 5.12.1

Bumps [eslint](https://github.com/eslint/eslint) from 5.12.0 to 5.12.1.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](eslint/eslint@v5.12.0...v5.12.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump ava from 1.1.0 to 1.2.0

Bumps [ava](https://github.com/avajs/ava) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/avajs/ava/releases)
- [Commits](avajs/ava@v1.1.0...v1.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump @types/node from 10.12.18 to 10.12.19

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped) from 10.12.18 to 10.12.19.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump @types/node from 10.12.19 to 10.12.20

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped) from 10.12.19 to 10.12.20.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump typescript from 3.2.4 to 3.3.1

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.2.4 to 3.3.1.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](microsoft/TypeScript@v3.2.4...v3.3.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump @types/node from 10.12.20 to 10.12.21

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped) from 10.12.20 to 10.12.21.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump eslint from 5.12.1 to 5.13.0

Bumps [eslint](https://github.com/eslint/eslint) from 5.12.1 to 5.13.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](eslint/eslint@v5.12.1...v5.13.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump jsdoc from `b214273` to `10c004f`

Bumps [jsdoc](https://github.com/jsdoc3/jsdoc) from `b214273` to `10c004f`.
- [Release notes](https://github.com/jsdoc3/jsdoc/releases)
- [Commits](jsdoc/jsdoc@b214273...10c004f)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump nyc from 13.1.0 to 13.2.0

Bumps [nyc](https://github.com/istanbuljs/nyc) from 13.1.0 to 13.2.0.
- [Release notes](https://github.com/istanbuljs/nyc/releases)
- [Changelog](https://github.com/istanbuljs/nyc/blob/master/CHANGELOG.md)
- [Commits](istanbuljs/nyc@v13.1.0...v13.2.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump ava from 1.2.0 to 1.2.1

Bumps [ava](https://github.com/avajs/ava) from 1.2.0 to 1.2.1.
- [Release notes](https://github.com/avajs/ava/releases)
- [Commits](avajs/ava@v1.2.0...v1.2.1)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump @types/node from 10.12.21 to 10.12.23

Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped) from 10.12.21 to 10.12.23.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* Bump typescript from 3.3.1 to 3.3.3

Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.3.1 to 3.3.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>

* TypeScript Re-Write (#83)

* wip ts rewrite

* odd?

* ah

* make min node 10

* fix appveyor

* cleaner export

* Revert "cleaner export"

This reverts commit 398a928.

* remove typings, update readme

* full sounds wrong with ts

* more official

* update npm ignore

* see if this fixes coverage

* fix coverage

* add a chmod test

* mode includes more than just the chmod

* who knows, tbh

* make it more interesting

* fk it

* switch to a basic typedocs

* fix output

* update npm description

* bump minor for new release
  • Loading branch information
bdistin committed Feb 10, 2019
1 parent f557b6d commit d62481f
Show file tree
Hide file tree
Showing 92 changed files with 2,231 additions and 2,123 deletions.
30 changes: 0 additions & 30 deletions .docstrap.json

This file was deleted.

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ package-lock.json

out/
coverage/
.nyc_output/
.nyc_output/
dist/
docs/
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ node_modules/
test/
docs/
scripts/
src/
.docstrap.json
.eslintrc.json
tslint.json
.travis.yml
appveyor.yml
tsconfig.json
package-lock.json
README.md
yarn.lock
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "8"
- "10"
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.12.3
- export PATH=$HOME/.yarn/bin:$PATH
Expand All @@ -11,10 +11,6 @@ jobs:
script: yarn run test:lint
- stage: coverage
script: bash ./scripts/.travis-coverage.sh
- # Node 10 test
script: bash ./scripts/.travis-coverage.sh
node_js:
- "10"
- # Node 11 test
script: bash ./scripts/.travis-coverage.sh
node_js:
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,20 @@ FS-Nextra
[![npm](https://img.shields.io/npm/v/fs-nextra.svg?maxAge=3600)](https://www.npmjs.com/package/fs-nextra)
[![npm](https://img.shields.io/npm/dt/fs-nextra.svg?maxAge=3600)](https://www.npmjs.com/package/fs-nextra)

[![codacy](https://api.codacy.com/project/badge/Grade/6bcb7d5133c94dd6902acb5ef626ff27)](https://www.codacy.com/app/dirigeants/fs-nextra?utm_source=github.com&utm_medium=referral&utm_content=bdistin/fs-nextra&utm_campaign=badger)
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/6bcb7d5133c94dd6902acb5ef626ff27)](https://www.codacy.com/app/dirigeants/fs-nextra?utm_source=github.com&utm_medium=referral&utm_content=bdistin/fs-nextra&utm_campaign=Badge_Coverage)
[![travic-ci](https://travis-ci.com/bdistin/fs-nextra.svg?branch=master)](https://travis-ci.com/bdistin/fs-nextra)
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/bdistin/fs-nextra.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/bdistin/fs-nextra/context:javascript)
[![Coverage Status](https://coveralls.io/repos/github/bdistin/fs-nextra/badge.svg?branch=master)](https://coveralls.io/github/bdistin/fs-nextra?branch=master)
[![travis-ci](https://travis-ci.com/bdistin/fs-nextra.svg?branch=master)](https://travis-ci.com/bdistin/fs-nextra)

[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=bdistin/fs-nextra)](https://dependabot.com)
[![david](https://david-dm.org/bdistin/fs-nextra.svg)](https://david-dm.org/bdistin/fs-nextra)
[![david](https://david-dm.org/bdistin/fs-nextra/dev-status.svg)](https://david-dm.org/bdistin/fs-nextra?type=dev)

Node.js V8 native fs, enhanced with util.promisify and standard extra methods. Written in full ES2017, sans every sync method. *Async is the future!*
Node.js V8 native fs.promises. Written in TypeScript, sans every sync method. *Async is the future!*

Docs
------

All `fs` methods which return a callback, return a promise instead. All `fs-extra` methods return a promise exclusively. No sync methods are included from either `fs` or `fs-extra`. Requires minimum Node.js v8.5.0.

> Note: If your node version is high enough, fs-nextra will automatically use fs/promises instead of util.promisify-ing fs.
All `fs` methods which return a callback, return a promise instead. All `nextra` methods return a promise exclusively. No sync methods are included from either `fs` or `fs-nextra`. Requires minimum Node.js v10.0.0.

The full documentation can be found here: [fs-nextra.js.org](https://fs-nextra.js.org/).

Expand Down
17 changes: 17 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
environment:
matrix:
- nodejs_version: "10"
- nodejs_version: "11"

install:
- ps: Install-Product node $env:nodejs_version
- yarn

test_script:
- yarn run test

build: off

cache:
- node_modules
- "%LOCALAPPDATA%\\Yarn"
26 changes: 12 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "fs-nextra",
"version": "0.3.8",
"description": "Node.js V8 native fs enhanced with util.promisify and standard extra methods.",
"main": "src/index.js",
"types": "typings/index.d.ts",
"version": "0.4.0",
"description": "Node.js native fs promises with next-generation extra methods.",
"main": "dist/index.js",
"scripts": {
"test": "npx ava test/*.js",
"test:lint": "npx eslint src test && npx tslint 'typings/*.ts'",
"build": "npx tsc",
"test": "npm run build && npx ava test/*.js",
"test:lint": "npx eslint test && npx tslint 'src/*.ts'",
"test:coverage": "npm run coverage && npx nyc check-coverage --lines 60 --functions 60 --branches 60",
"coverage": "npx nyc npm test",
"codacy": "npx nyc report --reporter=text-lcov | npx codacy-coverage",
"docs": "npx jsdoc -c ./.docstrap.json -R README.md",
"lint": "npx eslint --fix src test && npx tslint --fix 'typings/*.ts'"
"coveralls": "npx nyc report --reporter=text-lcov | npx coveralls",
"docs": "npx typedoc --mode file --out ./docs/ ./src/",
"lint": "npx eslint --fix test && npx tslint --fix 'src/*.ts'"
},
"keywords": [
"atomics",
Expand All @@ -32,19 +32,17 @@
"author": "BDISTIN",
"license": "MIT",
"engines": {
"node": ">=8.5.0"
"node": ">=10.0.0"
},
"devDependencies": {
"@types/node": "^10.1.3",
"ava": "^1.0.1",
"codacy-coverage": "^3.0.0",
"coveralls": "^3.0.2",
"eslint": "^5.2.0",
"eslint-config-klasa": "github:dirigeants/klasa-lint",
"ink-docstrap": "github:bdistin/docstrap",
"jsdoc": "github:jsdoc3/jsdoc",
"nyc": "^13.0.1",
"tslint": "^5.7.0",
"tsubaki": "^1.2.0",
"typedoc": "^0.14.2",
"typescript": "^3.0.1"
},
"repository": {
Expand Down
12 changes: 3 additions & 9 deletions scripts/.travis-coverage.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
#!/bin/bash
set -e

if [ "$TRAVIS_BRANCH" != "master" -o -n "$TRAVIS_TAG" -o "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Testing a non master branch push - testing without reporting."
npm run test:coverage
exit 0
fi

# For Node != 8, do nothing
if [ "$TRAVIS_NODE_VERSION" != "8" ]; then
if [ "$TRAVIS_NODE_VERSION" != "10" ]; then
echo -e "Build triggered with Node v${TRAVIS_NODE_VERSION} - testing without reporting."
npm run test:coverage
exit 0
fi

echo -e "Testing a master branch push - testing and reporting coverage."
echo -e "Build triggered with Node v${TRAVIS_NODE_VERSION} - testing and reporting coverage."

npm run test:coverage

npm run codacy
npm run coveralls
71 changes: 43 additions & 28 deletions src/fs.js → src/fs.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
const fs = require('fs');

if (fs.promises) {
const otherMethods = {};
for (const [key, value] of Object.entries(fs)) if (!key.includes('Sync') && !(`${key}Sync` in fs)) otherMethods[key] = value;
module.exports = { ...fs.promises, ...otherMethods };
} else {
const { promisify } = require('util');

for (const [key, value] of Object.entries(fs)) {
if (key.includes('Sync')) continue;
if (`${key}Sync` in fs) exports[key] = promisify(value);
else exports[key] = value;
}
}
import * as fs from 'fs';

export const {
access,
copyFile,
open,
rename,
truncate,
rmdir,
mkdir,
readdir,
readlink,
symlink,
lstat,
stat,
link,
unlink,
chmod,
lchmod,
lchown,
chown,
utimes,
realpath,
mkdtemp,
writeFile,
appendFile,
readFile
} = fs.promises;

export { createReadStream, createWriteStream, unwatchFile, watch, watchFile, Dirent, Stats, ReadStream, WriteStream, constants } from 'fs';

/* eslint-disable max-len */

Expand Down Expand Up @@ -167,15 +182,15 @@ if (fs.promises) {
*/

/**
* Emitted when the readstream closes.
* Emitted when the ReadStream closes.
* @event ReadStream#close
* @instance
*/

/**
* Emitted when the readstream's file is opened.
* Emitted when the ReadStream's file is opened.
* @event ReadStream#open
* @property {number} fd The file discriptor.
* @property {number} fd The file descriptor.
* @instance
*/

Expand All @@ -189,15 +204,15 @@ if (fs.promises) {
*/

/**
* Emitted when the readstream closes.
* Emitted when the ReadStream closes.
* @event WriteStream#close
* @instance
*/

/**
* Emitted when the readstream's file is opened.
* Emitted when the ReadStream's file is opened.
* @event WriteStream#open
* @property {number} fd The file discriptor.
* @property {number} fd The file descriptor.
* @instance
*/

Expand Down Expand Up @@ -415,15 +430,15 @@ if (fs.promises) {
/**
* @typedef {Object} EncodingOptions
* @memberof fsn/fs
* @property {string} [encoding = 'utf8'] The encoding for the temperary directory
* @property {string} [encoding = 'utf8'] The encoding for the temporary directory
*/

/**
* Identical to {@link https://nodejs.org/api/fs.html#fs_fs_mkdtemp_prefix_options_callback|fs.mkdtemp} but returns a promise instead.
* @function mkdtemp
* @memberof fsn/fs
* @param {string} prefix The prefix of the temperary folder to create
* @param {EncodingOptions|string} [options = 'utf8'] The temperary directory options, or encoding
* @param {string} prefix The prefix of the temporary folder to create
* @param {EncodingOptions|string} [options = 'utf8'] The temporary directory options, or encoding
* @returns {Promise<string>} The folder path
*/

Expand All @@ -440,7 +455,7 @@ if (fs.promises) {
/**
* @typedef {Object} ReadObject
* @memberof fsn/fs
* @property {number} bytesRead The numberof bytes read
* @property {number} bytesRead The number of bytes read
* @property {Buffer|Uint8Array} buffer The buffer containing the data read
*/

Expand All @@ -451,8 +466,8 @@ if (fs.promises) {
* @param {number} fd The file descriptor
* @param {Buffer|Uint8Array} buffer The buffer that he data will be written to.
* @param {number} offset The offset in the buffer to start writing at
* @param {number} length The thenumber of bytes to read
* @param {number} position The the postition to begin reading from the file
* @param {number} length The the number of bytes to read
* @param {number} position The the postilion to begin reading from the file
* @returns {Promise<ReadObject>}
*/

Expand Down Expand Up @@ -599,7 +614,7 @@ if (fs.promises) {
* @param {Buffer|Uint8Array} buffer The buffer to write to file
* @param {number} [offset] The offset in the buffer to start reading at
* @param {number} [length] The the number of bytes to write
* @param {number} [position] The the postition to begin writing to the file
* @param {number} [position] The the position to begin writing to the file
* @returns {Promise<void>}
*/

Expand Down
47 changes: 0 additions & 47 deletions src/index.js

This file was deleted.

Loading

0 comments on commit d62481f

Please sign in to comment.