New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

printen

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

printen

These printens look so tasty, and quite similar to a package called stringify-object, which I love.

  • 1.0.0-2
  • latest
  • Source
  • npm
  • Socket score

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

           .──────◯──────────────.
     _.─◯─'◦  ◯  ◦   ◯  ◦  ◯   ◯ ◡`─◌──.
  ,─___◡  __◌_  __◦ __ ◡  ___◦  __◦_  __'_.
 ╱ (  _ \(  _ \(  )(  ( \(_  _)(  __)(  ( \╲
(   ) __/ )   / )( /    /  )(   ) _) /    / )
▒`.(__)  (__\_)(__)\_)__) (__) (____)\_)__)'▒
 ▒▒'─. ◌  ◦   ◯ ◡   ◦ ◡  ◯ ◌   ◯     ◌ ,─'▒▒
   ▒▒▒`────◯ ◡   ◯   ◌     ◡ ◦   _.◯──'▒▒▒
      ▒▒▒▒▒▒`─◦─────────◯──────◯'▒▒▒▒▒▒
            ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒

These printens look so tasty, and quite similar to a package called stringify-object, which I love.

Why

  • Printed plain objects should be easy readable by humans
  • Printed plain objects should be easy readable by robots

Install

$ npm install printen

Usage

Running

const printen = require('printen')
const exampleData = {
	title: "Printen Examples",
	stars: Number.POSITIVE_INFINITY,
	cons: undefined,
	pros: [
		'They are gross',
		'They are tasty'
	],
	cons: [],
	attributes: {
		color: 'brown',
		jellyBeans: 4
	}
}

console.log(printen(exampleData))

prints

Unnecessary clutter is hidden from the output, as the prefixes for subsequent attributes. But since it is hidden you can still access it via grep:

$ node printen-example.js | grep pros                   
pros.0:	They are gross
pros.1:	They are tasty

The key-value separator is in fact a colon and a tab-character therefore you can use cut to access the value:

$ node printen-example.js | grep pros | cut -f 2
They are gross
They are tasty

API

printen(object, prefix)

ParameterTypeNecessityDescription
objectPlainObjectmandatoryPlain object to be stringified by printen
prefixStringoptionalPrefix to be used before each line, use this f.e. to indent the output

License

MIT © Florian Breisch

FAQs

Package last updated on 07 Mar 2017

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