New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

grim-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grim-wrapper

Rewrap comment blocks to make them readable

latest
Source
npmnpm
Version
1.2.4
Version published
Maintainers
1
Created
Source

Grim Wrapper

npm Node.js CI status

Rewrap comment blocks to make them readable.

Washing your code. A book on clean code for frontend developers

Features

  • Very small, no dependencies.
  • Works in most popular programming languages, Markdown, and plain text.
  • Supports Markdown lists and JavaDoc/JSDoc/XMLDoc tags.
  • Limited scope to a single paragraph (part of a comment separated by empty lines).
  • Almost zero config: the only option is maximum line length.

Getting started

  • Install Grim Wrapper from npm:
npm install grim-wrapper
  • Call the wrapComment function with the comment text and the desired maximum line length. Note that it works with comment paragraphs (lines between “empty” lines).
import { wrapComment } from 'grim-wrapper';

wrapComment(
  '// Bicycle rights disrupt craft beer butcher bagel biodiesel vintage asymmetrical wet cappuccino underconsuption High Life Prenzlauer Berg chia kitsch.',
  80
);
// →
// Bicycle rights disrupt craft beer butcher bagel biodiesel vintage
// asymmetrical wet cappuccino underconsuption High Life Prenzlauer Berg chia
// kitsch.

Motivation

I’ve been using Rewrap for a long time, but it doesn’t always do what I want:

  • No support for JSX comments.
  • Often weird formatting of multiline comments (/* ... */, etc.).
  • I don’t like the way it format Markdown todos and JSDoc tags.

Check out samples to get an idea how it formats comments.

Guidelines

  • Separate the comment from the marker with a space (// Comment or /* Comment */).
  • Write in sentence case (Comment here, comment there).
  • Finish sentences with a dot (.) for JSDoc comments, feel free to skip it for single-line comments.
  • Prefer line comments (// or #) to block comments (/* ... */) for documenting code inside functions.
  • Prefer JSDocs comments (/** ... */) to document functions, methods, classes, constants, types, etc.
  • Prefer comments on their own line. Avoid end-of-line comments.
  • Use prefixes such as TODO or HACK to highlight unfinished or hacky code.

Sources

Sponsoring

This software has been developed with lots of coffee, buy me one more cup to keep it going.

Buy Me A Coffee

Contributing

Bug fixes are welcome, but not new features. Please take a moment to review the contributing guidelines.

Authors and license

Artem Sapegin and contributors.

MIT License, see the included License.md file.

FAQs

Package last updated on 17 Dec 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