New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Maintainers
1
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc