Socket
Book a DemoInstallSign in
Socket

pynput

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pynput

simple, small, zero dependency library for reading input

0.4.0
latest
Source
npmnpm
Version published
Weekly downloads
4
-20%
Maintainers
1
Weekly downloads
 
Created
Source

pynput

Simple, small, easy and zero dependency input function similar to the one in Python.

Motivation

I wanted a simple way to accept user input from terminal, especially one closer to python or a library without much dependencies. and also learn how to build a library I could use when needed.

Installation

Install pynput with npm (or any package manager)

npm i pynput

Usage/Examples

import { input } from "pynput"

const name = await input("Name: ") // joe

console.log(name) // -> joe
// converting an int/float
import { input } from "pynput"

const age = await input("Age: ", {convert: "int"}) // 10

console.log(10) // -> 10

Contributing

Contributions and pull requests are always welcome!

Acknowledgements

Inspired by Python's input built-in function.

License

MIT

Keywords

input

FAQs

Package last updated on 30 Mar 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.