Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eprint

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eprint

Run your script in Electron and print to terminal

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Eprint

For when you want to run a script in the browser - without opening a browser, and print something of value to the terminal. Why would you ever need to do that? In my case I needed to run various benchmarks in the browser and somehow output the result to the terminal. Reason why it is called Eprint is because we're utilizing Electron under the hood.

How to use

First install in your project.

npm install --save-dev eprint

Call eprint and eprintKill in your script (Note that both are global functions).

// do some computation
eprint('my script result')
// when script finished execution, call eprintKill to quit
eprintKill()

If you are using TypeScript, include this file in your source so that TypeScript won't complain.

// eprint.d.ts
export {}

declare global {
  var eprint: (str: string) => void
  var eprintKill: () => void
}

Compile your script and call it with eprint to execute and print result to terminal.

npm run build && npx eprint dist/my-script.js

You'll probably want to add a script to package.json for convenience.

  "scripts": {
    ...
    "benchmark": "npm run build-benchmark && eprint dist/benchmark.js"
  }

Reference

eprint

Print given string to the terminal. You can replace console.log with this function. Only caveat is it won't automatically print object so maybe call JSON.stringify prior.

eprintKill

Take no argument. Call this function when your script finished execution to stop Eprint process.

FAQs

Package last updated on 23 Dec 2020

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