🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

copy-file-content

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

copy-file-content

Copy file content to clipboard

1.0.1
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

copy-file-content

Latest Stable Version Total Downloads

Very simple package to copy the file content to your clipboard

Motivation

I was tired of opening text files to copy their content, so I created this package.

Usage

There's 2 ways of using

Using the package globally as a command tool

First install the package globally

pnpm add copy-file-content -g

Then you can use it to the file content

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

pnpm add copy-file-content

Then import the function and use it

import { copyFileContent } from 'copy-file-content';

await copyFileContent('file.html');

After this, the file content will be avaiable in the clipboard

Arguments

NameTypeRequiredDefault
--encodingBufferEncodingfalseutf-8

You can also use the arguments as options in the second argument of the exported function copyFileContent, like this:

import { copyFileContent } from 'copy-file-content';

await copyFileContent('file.html', { encoding: 'utf-16' });

Requirements

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

Keywords

copy

FAQs

Package last updated on 09 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts