Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Pull of Main repo #58

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4db7cc0
Merge pull request #1 from aashutoshrathi/fix/CVE-2023-26115
aashutoshrathi Apr 14, 2023
d21f8ee
bump: v1.2.4
aashutoshrathi Apr 14, 2023
aa1cc3a
:arrow_up: update package name
aashutoshrathi Apr 15, 2023
87a3667
:fire: rm unused deps causing CVE issues
aashutoshrathi Apr 17, 2023
21e2903
:lock: fix: mocha in audit
aashutoshrathi Jun 28, 2023
620114a
Merge pull request #2 from aashutoshrathi/v1.2.6
aashutoshrathi Jun 28, 2023
24f98f0
update README badeges
aashutoshrathi Jun 28, 2023
8498142
Merge pull request #3 from aashutoshrathi/update-readme-badges
aashutoshrathi Jun 29, 2023
804ab42
fix: installation and import methods
wellwelwel Jul 6, 2023
cd1e9d5
ci: add initial tests
wellwelwel Jul 6, 2023
4e6f73c
chore: add package-lock.json
wellwelwel Jul 6, 2023
384194d
ci: remove old node versions from matrix
wellwelwel Jul 6, 2023
b265a97
ci: rename jobs
wellwelwel Jul 6, 2023
497c57e
chore: polishing README.md changes
wellwelwel Jul 6, 2023
506cbcd
:arrow_up: bump: v1.2.7 & prepare for CI
aashutoshrathi Jul 6, 2023
feb7c53
Update README.md with deep dependencies workaround
emilorol Jul 6, 2023
a744068
chore: add CI badge
wellwelwel Jul 6, 2023
bfe28e6
Merge pull request #8 from wellwelwel/master
aashutoshrathi Jul 7, 2023
91bcfa7
Merge pull request #7 from emilorol/patch-1
aashutoshrathi Jul 9, 2023
b412747
Merge pull request #6 from aashutoshrathi/v1.2.7
aashutoshrathi Jul 10, 2023
b04aa64
Update README.md
aashutoshrathi Aug 25, 2023
09faf9d
Merge branch 'master' into master
aashutoshrathi Dec 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
pull_request:
push:
branches: [ master ]
workflow_dispatch:

jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [16.x, 18.x, 20.x]

name: Node.js ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v3

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: npm-${{ hashFiles('package-lock.json') }}
restore-keys: npm-

- name: Install npm dependencies
run: npm ci

- name: Testing
run: npm run test
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock.json
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2016, Jon Schlinkert
Copyright (c) 2014-2023, Jon Schlinkert

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
33 changes: 30 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# word-wrap [![NPM version](https://img.shields.io/npm/v/word-wrap.svg?style=flat)](https://www.npmjs.com/package/word-wrap) [![NPM monthly downloads](https://img.shields.io/npm/dm/word-wrap.svg?style=flat)](https://npmjs.org/package/word-wrap) [![NPM total downloads](https://img.shields.io/npm/dt/word-wrap.svg?style=flat)](https://npmjs.org/package/word-wrap) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/word-wrap.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/word-wrap)
> [!NOTE]
> If you came here looking for what this package is, as it showed up on top of your node_modules. This is probably a dependency of [Optionator](https://www.npmjs.com/package/optionator) in your project.

> **Why this fork?**

> word-wrap had a high rank vulnerability ([CVE-2023-26115](https://security.snyk.io/vuln/SNYK-JS-WORDWRAP-3149973)) which is now fixed in [this PR](https://github.com/jonschlinkert/word-wrap/pull/33) and now the main package can be used too. It was taking time to merge that PR so, some projects shifted to this fork of the project.

# word-wrap [![NPM version](https://img.shields.io/npm/v/%40aashutoshrathi/word-wrap.svg?style=flat)](https://www.npmjs.com/package/%40aashutoshrathi/word-wrap) [![NPM monthly downloads](https://img.shields.io/npm/dm/%40aashutoshrathi/word-wrap.svg?style=flat)](https://npmjs.org/package/%40aashutoshrathi/word-wrap) [![NPM total downloads](https://img.shields.io/npm/dt/%40aashutoshrathi/word-wrap.svg?style=flat)](https://npmjs.org/package/%40aashutoshrathi/word-wrap) ![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/aashutoshrathi/word-wrap/ci.yml?style=flat)

> Wrap words to a specified length.

Expand All @@ -9,13 +16,33 @@ Please consider following this project's author, [Jon Schlinkert](https://github
Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save word-wrap
$ npm install --save @aashutoshrathi/word-wrap
```

## Deep Dependencies Workaround

If you are running `yarn audit` or `npm audit` and you get failures like `"word-wrap vulnerable to Regular Expression Denial of Service"` here is a work around if one of your dependencies is still using an old version of the original library.

**YARN**

```json
"resolutions": {
"word-wrap": "@aashutoshrathi/word-wrap"
}
```

**NPM (8 or higher)**

```json
"overrides": {
"word-wrap" : "@aashutoshrathi/word-wrap"
}
```

## Usage

```js
var wrap = require('word-wrap');
var wrap = require('@aashutoshrathi/word-wrap');

wrap('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.');
```
Expand Down
8 changes: 4 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "word-wrap",
"description": "Wrap words to a specified length.",
"repository": "jonschlinkert/word-wrap",
"repository": "aashutoshrathi/word-wrap",
"license": "MIT",
"homepage": "https://github.com/jonschlinkert/word-wrap",
"homepage": "https://github.com/aashutoshrathi/word-wrap",
"authors": [
"Jon Schlinkert (https://github.com/jonschlinkert)"
],
Expand All @@ -30,7 +30,7 @@
],
"version": "1.2.1",
"bugs": {
"url": "https://github.com/jonschlinkert/word-wrap/issues"
"url": "https://github.com/aashutoshrathi/word-wrap/issues"
},
"files": [
"index.js"
Expand All @@ -57,4 +57,4 @@
"Wolfgang Faust (http://www.linestarve.com)",
"Zach Hale <zachhale@gmail.com> (http://zachhale.com)"
]
}
}
Loading