-
Notifications
You must be signed in to change notification settings - Fork 52
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
Programic API #28
Comments
yeah I can try to add some more details on the programmatic api, I'm not sure when I'm going to get to it, I'm kinda swamped with some stuff right now so pull requests would always help |
@calvinmetcalf Great job! I would also need more information. cheers! |
the signature is copyfiles(paths, opts, callback); with paths being an array of the input paths and the output being the last path and config being an object where the names correspond to the flags so you'd want it to be |
THX @calvinmetcalf for your answer! Here is some source code as documentation for the options: .option('-u, --up [levels]', 'slice a path off the bottom of the paths', parseInt)
.option('-a --all', 'include files and directories whose names begin with a dot (.)')
.option('-f, --flat', 'flatten the output')
.option('-e, --exclude [pattern]', 'pattern or glob to exclude')
.option('-s, --soft', 'do not overwrite destination files if they exist') as the key in the options object corresponds to the flags i guess i would be able to use short and long version. So i could use |
no just the long option, so you can have 'all', 'flat', 'exclude' and 'soft' |
Actually in my case where I wanted to flatten while copying Programmatically I had to do this:
I found this out by checking your tests. This really needs to be documented |
I know this issue is pretty old but using After looking through the code I saw that
@calvinmetcalf might be worth allowing people to use
If you agree, I can create a PR. |
hello, |
Yes docs is very poor and lies that |
Your copy operation is very simple, so I recommend NodeJS built in
Or you can use async alternative |
Desperate need for documentation here.
I have been an advocate for npm scripting of build processes for many departments at my work and I sold them a group of npm packages to get the job done,
copyfiles
being one of them. We have recently converted from npm scripts within package.json to writing out a node build file.We are going to have to switch away from
copyfiles
do to the lack of documentation and below.On the command line that makes sense, programatically it is nonsensical. I can't explain to other developers why the "last item in the array is the destination" and any new developer coming on board would have to get taught that as well.
This npm package has been great to me, I would love to see more documentation on "programmatic" usage as well an additional parameter when calling
copyfiles
in that environment.Something like:
copyfiles(path, dest [, opts] [, callback])
Example
Example w/opts
The text was updated successfully, but these errors were encountered: