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

print-code

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

print-code - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

index.js

@@ -142,3 +142,3 @@ 'use strict';

return whitespaces(LINE_NO_SPAN_LENGTH + caret - 1, '-')
+ '^ '
+ '^ '
+ 'column: ' + column

@@ -145,0 +145,0 @@ }

{
"name": "print-code",
"version": "1.0.1",
"version": "1.0.2",
"description": "Print visualized slice of code from its content, line and column for CLI",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -27,9 +27,20 @@ [![Build Status](https://travis-ci.org/kaelzhang/node-print-code.svg?branch=master)](https://travis-ci.org/kaelzhang/node-print-code)

code(content)
.slice(10, 14)
.max_columns(78)
.highlight(12)
.arrow_mark(12, column)
.highlight(4)
.slice(1, 6)
.max_columns(68)
.arrow_mark(4, 10)
.print()
```
And then the output might be (Line No 4 is red):
```
1| 'use strict';
2|
3| module.exports = code
4| code.Code = Code
----------------^ column: 10
5|
```
#### .slice([from] [, to])

@@ -36,0 +47,0 @@

@@ -11,6 +11,6 @@ 'use strict';

code(content)
.highlight(10, 11)
.slice(1, 12)
.highlight(4)
.slice(1, 6)
.max_columns(68)
.arrow_mark(11, 70)
.arrow_mark(4, 10)
.print()
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