Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/springtype-org/st-cp

The missing cp -rp for Node.js, Windows, Linux, Mac OS using native executables
https://github.com/springtype-org/st-cp

cli copy cross-platform directory file native node-module nodejs permissions recursive

Last synced: 3 days ago
JSON representation

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

Awesome Lists containing this project

README

        

## st-cp

[![Gitter](https://badges.gitter.im/springtype-official/springtype.svg)](https://gitter.im/springtype-official/springtype?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

![Node CI](https://github.com/springtype-org/st-cp/workflows/Node%20CI/badge.svg?branch=master)

> 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`.
````$typescript
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: `(): `

`` 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:

- https://www.conventionalcommits.org/
- https://seesparkbox.com/foundry/semantic_commit_messages
- http://karma-runner.github.io/1.0/dev/git-commit-msg.html

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](./CONTRIBUTORS.md) :tada: