Skip to content

The missing cp -rp for Node.js, Windows, Linux, Mac OS using native executables

License

Notifications You must be signed in to change notification settings

springtype-org/st-cp

Repository files navigation

st-cp

Gitter

Node CI

Cross-platform cp copy easy files and folders: create missing folders automatically

use it programmatically: install via npm i st-cp or yarn add st-cp.

import {copyPathOrFile} from 'st-cp';

copyPathOrFile('sourcePath',{path: 'destinationPath', isDirectory: true});

use the cli npx st-cp source destination

Parameter

source

  • required
  • multiple (files and folders)

destination

  • required
  • enforce folder with / @ the end

Examples:

copy files to a folder

 # before
 ├── --- file1
 ├── --- file2
 ├── --- file3

st-cp file1 file2 file3 folder

 # after
 ├── --- file1
 ├── --- file2
 ├── --- file3
 ├── --- folder/file1
 ├── --- folder/file2
 ├── --- folder/file3

copy file to a folder

 # before
 ├── --- file

st-cp file folder/

 # after
 ├── --- file
 ├── --- folder/file

copy file to a file (create a folder)

 # before
 ├── --- file

st-cp file folder/new-file

 # after
 ├── --- file
 ├── --- folder/new-file

copy folder to folder

 # before
 ├── --- folder

st-cp folder folder1

 # after
 ├── --- folder
 ├── --- folder1

copy files and folders to destination

 # before
 ├── --- file1
 ├── --- file2
 ├── --- folder1
 ├── --- folder2

st-cp file folder dist

 # after
 ├── --- file1
 ├── --- file2
 ├── --- folder1
 ├── --- folder2
 ├── --- dist/file1
 ├── --- dist/file2
 ├── --- dist/folder1
 ├── --- dist/folder2

Exceptional:

copy file to existing folder

 # before
 ├── --- file
 ├── --- folder

st-cp file folder

 # after
 ├── --- file
 ├── --- folder
 ├── --- folder/file

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

feat: add hat wobble
^--^  ^------------^
|     |
|     +-> Summary in present tense.
|
+-------> Type: chore, docs, feat, fix, refactor, style, or test.

More Examples:

  • feat: (new feature for the user, not a new feature for build script)
  • fix: (bug fix for the user, not a fix to a build script)
  • docs: (changes to the documentation)
  • style: (formatting, missing semi colons, etc; no production code change)
  • refactor: (refactoring production code, eg. renaming a variable)
  • test: (adding missing tests, refactoring tests; no production code change)
  • chore: (updating grunt tasks etc; no production code change)

References:

Backers

Thank you so much for supporting us financially! 🙏🏻😎🥳👍


Tom

Maintainers

SpringType is brought to you by:


Aron Homberg

Michael Mannseicher

Contributing

Please help out to make this project even better and see your name added to the list of our CONTRIBUTORS.md 🎉