copy-file-content
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -0,0 +0,0 @@ #!/usr/bin/env node |
@@ -1,1 +0,1 @@ | ||
export const VERSION = '1.0.0'; | ||
export const VERSION = '1.0.1'; |
@@ -0,0 +0,0 @@ import { copy } from 'copy-paste'; |
{ | ||
"name": "copy-file-content", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Copy file content to clipboard", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -0,0 +0,0 @@ import { readFile, writeFile } from 'fs/promises'; |
@@ -25,9 +25,10 @@ # copy-file-content | ||
``` | ||
```shell | ||
copy-file-content file.html | ||
``` | ||
After this, the file content will be avaiable in the clipboard | ||
### Using the package as a dependency | ||
Add the package as a dependency | ||
``` | ||
```shell | ||
pnpm add copy-file-content | ||
@@ -43,2 +44,3 @@ ``` | ||
``` | ||
After this, the file content will be avaiable in the clipboard | ||
@@ -51,6 +53,19 @@ ## Arguments | ||
You can also use the arguments as options in the second arguments of the exported function `copyFileContent` | ||
You can also use the arguments as options in the second argument of the exported function `copyFileContent`, like this: | ||
```typescript | ||
import { copyFileContent } from 'copy-file-content'; | ||
await copyFileContent('file.html', { encoding: 'utf-16' }); | ||
``` | ||
## Requirements | ||
Node.js version 16 or superior | ||
Node.js version 16 or superior | ||
## Notes | ||
- This package only works in a Node.js environments, it was not tested in the browser | ||
- This package is ESM only, it was not tested with CommonJS | ||
- This package only works with text files. It will not copy the content of a .xlsx, for example | ||
- This package does not validate how big the file is, I made it to be used with small files |
Sorry, the diff of this file is not supported yet
7690
68