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

monocart-code-viewer

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

monocart-code-viewer - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

dist/monocart-code-viewer.d.ts

16

package.json
{
"name": "monocart-code-viewer",
"version": "1.1.2",
"version": "1.1.3",
"description": "Monocart Code Viewer",
"main": "dist/monocart-code-viewer.js",
"exports": {
".": {
"types": "./dist/monocart-code-viewer.d.ts",
"default": "./dist/monocart-code-viewer.js"
},
"./package.json": "./package.json"
},
"types": "./dist/monocart-code-viewer.d.ts",
"scripts": {

@@ -24,3 +32,3 @@ "dev": "sf d",

"@codemirror/lang-javascript": "^6.2.2",
"@codemirror/view": "^6.24.1",
"@codemirror/view": "^6.26.1",
"@lezer/common": "^1.2.1",

@@ -30,3 +38,3 @@ "@lezer/css": "^1.1.8",

"@lezer/javascript": "^1.4.13",
"@uiw/codemirror-theme-xcode": "^4.21.24",
"@uiw/codemirror-theme-xcode": "^4.21.25",
"codemirror": "^6.0.1",

@@ -37,5 +45,5 @@ "eslint": "^8.57.0",

"lz-utils": "^2.0.2",
"stylelint": "^16.2.1",
"stylelint": "^16.3.1",
"stylelint-config-plus": "^1.1.0"
}
}
# monocart-code-viewer
[![](https://img.shields.io/npm/v/monocart-code-viewer)](https://www.npmjs.com/package/monocart-code-viewer)
[![](https://badgen.net/npm/dw/monocart-code-viewer)](https://www.npmjs.com/package/monocart-code-viewer)
![](https://img.shields.io/librariesio/github/cenfun/monocart-code-viewer)
![](https://img.shields.io/github/license/cenfun/monocart-code-viewer)
Code Viewer with Coverage View base on [CodeMirror](https://codemirror.net/)
## Feature
- Base on [CodeMirror](https://codemirror.net/)
- Coverage View
## Install
```sh
npm i monocart-code-viewer
```
## Usage
```js

@@ -11,8 +23,39 @@ import { createCodeViewer } from 'monocart-code-viewer';

const report = {
content: "",
content: "your source content",
coverage: {
uncoveredLines: {},
uncoveredPieces: {},
executionCounts: {},
decorations: {}
uncoveredLines: {
'0': 'comment',
'1': 'blank',
'8': 'partial',
'9': 'uncovered'
},
uncoveredPieces: {
'8': [
{
'start': 27,
'end': 34
}
]
},
decorations: {
'14': [
{
'column': 4,
'value': 'E',
'attrs': {
'title': 'else path uncovered'
}
}
]
},
executionCounts: {
'20': [
{
'column': 22,
'count': 10,
'value': '10',
'end': 916
}
]
}
}

@@ -25,3 +68,9 @@ };

codeViewer = createCodeViewer($el, report);
codeViewer.on('cursor', (loc) => {
// console.log('cursor', loc);
});
// codeViewer.setSelection(start, end, options);
// codeViewer.setCursor(pos, options);
}
```

Sorry, the diff of this file is too big to display

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