Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add fs/copy-file #2201

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

HRIDYANSHU054
Copy link
Contributor

@HRIDYANSHU054 HRIDYANSHU054 commented Apr 23, 2024

adds file system copy file utility to Stdlib

Description

What is the purpose of this pull request?

This pull request:

is aligned with the purpose of achievinng feature parity with Node.js fs package. It Brings file system's powerful copy file utility to Stdlib expanding its existing fs utilities. It also tends to make the copy File utility version independent for node. Moreover, with this I also wish to know with what approach do we further add abstractions over the fs utilities.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Implementation details

-- async version

function onCopy( error ) {
    if ( error ) {
        throw error;
    }
    console.log( 'src.txt has been copied to dest.txt' );
}

copyFile( 'src.txt', 'dest.txt', onCopy );

-- sync version

var copyFile = require( '@stdlib/fs/copy-file' );

// Explicitly handle the error...
var err = copyFileSync( 'src.txt', 'dest.txt' );
if ( err instanceof Error ) {
    throw err;
}

more --> currently researching on how fs/constants could be implemented for stdlibsuch that further feature parity and version independency are achievable.

Checklist

Please ensure the following tasks are completed before submitting this pull request.


@stdlib-js/reviewers

@Planeshifter Planeshifter changed the title Added fs/copy file feat: add fs/copy Apr 24, 2024
@HRIDYANSHU054
Copy link
Contributor Author

Hi @Planeshifter could you rerun the CI checks so that I can rectify anything that isn't correct?

@HRIDYANSHU054
Copy link
Contributor Author

@kgryte , @Planeshifter could you rerun the CI check

@kgryte kgryte changed the title feat: add fs/copy feat: add fs/copy-file May 8, 2024
@Planeshifter Planeshifter self-requested a review May 8, 2024 19:43
@Planeshifter
Copy link
Member

/stdlib update-copyright-years

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants