Comparing version 1.0.2 to 1.1.0
{ | ||
"name": "linebreak", | ||
"version": "1.0.2", | ||
"version": "1.1.0", | ||
"description": "An implementation of the Unicode Line Breaking Algorithm (UAX #14)", | ||
"source": "src/linebreaker.js", | ||
"type": "module", | ||
"main": "dist/main.cjs", | ||
"module": "dist/module.mjs", | ||
"exports": { | ||
"require": "./dist/main.cjs", | ||
"import": "./dist/module.mjs" | ||
}, | ||
"files": [ | ||
"dist" | ||
], | ||
"repository": { | ||
@@ -22,17 +33,26 @@ "type": "git", | ||
"base64-js": "0.0.8", | ||
"brfs": "^2.0.2", | ||
"unicode-trie": "^1.0.0" | ||
"unicode-trie": "^2.0.0" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^6.0.2" | ||
"mocha": "^10.0.0", | ||
"parcel": "^2.5.0", | ||
"request": "^2.88.0" | ||
}, | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "parcel build && mocha --reporter landing", | ||
"build": "parcel build", | ||
"prepublishOnly": "parcel build" | ||
}, | ||
"main": "src/linebreaker", | ||
"browserify": { | ||
"transform": [ | ||
"brfs" | ||
] | ||
"targets": { | ||
"main": { | ||
"includeNodeModules": [ | ||
"fs" | ||
] | ||
}, | ||
"module": { | ||
"includeNodeModules": [ | ||
"fs" | ||
] | ||
} | ||
} | ||
} |
@@ -5,12 +5,11 @@ # linebreak | ||
> Line breaking, also known as word wrapping, is the process of breaking a section of text into lines such that it will fit in the | ||
> available width of a page, window or other display area. The Unicode Line Breaking Algorithm performs part of this process. | ||
> Given an input text, it produces a set of positions called "break opportunities" that are appropriate points to begin a new line. | ||
> The selection of actual line break positions from the set of break opportunities is not covered by the Unicode Line Breaking Algorithm, | ||
> available width of a page, window or other display area. The Unicode Line Breaking Algorithm performs part of this process. | ||
> Given an input text, it produces a set of positions called "break opportunities" that are appropriate points to begin a new line. | ||
> The selection of actual line break positions from the set of break opportunities is not covered by the Unicode Line Breaking Algorithm, | ||
> but is in the domain of higher level software with knowledge of the available width and the display size of the text. | ||
This is a JavaScript implementation of the | ||
[Unicode Line Breaking Algorithm](http://www.unicode.org/reports/tr14/#SampleCode) for Node.js | ||
(and browsers I guess). It is used by [PDFKit](http://github.com/devongovett/pdfkit/) for | ||
line wrapping text in PDF documents, but since the algorithm knows nothing about the actual | ||
visual appearance or layout of text, it could be used for other things as well. | ||
This is a JavaScript implementation of the [Unicode Line Breaking Algorithm](http://www.unicode.org/reports/tr14/#SampleCode) for Node.js | ||
(and browsers I guess). Currently supports Unicode version 13. It is used by [PDFKit](http://github.com/devongovett/pdfkit/) for | ||
line wrapping text in PDF documents, but since the algorithm knows nothing about the actual visual appearance or layout of text, | ||
it could be used for other things as well. | ||
@@ -37,3 +36,3 @@ ## Installation | ||
console.log(word); | ||
// you can also check bk.required to see if this was a required break... | ||
@@ -43,3 +42,3 @@ if (bk.required) { | ||
} | ||
last = bk.position; | ||
@@ -54,9 +53,9 @@ } | ||
* The `src/classes.coffee` file is automatically generated from `LineBreak.txt` in the Unicode | ||
database by `src/generate_data.coffee`. It should be rare that you need to run this, but | ||
* The `src/classes.js` file is automatically generated from `LineBreak.txt` in the Unicode | ||
database by `src/generate_data.js`. It should be rare that you need to run this, but | ||
you may if, for instance, you want to change the Unicode version. | ||
* You can run the tests using `npm test`. They are written using `mocha`, and generated from | ||
`LineBreakTest.txt` from the Unicode database, which is included in the repository for performance | ||
reasons while running them. About 150 of the over 6000 tests are currently skipped due to | ||
reasons while running them. About 50 of the over 7600 tests are currently skipped due to | ||
implementation differences. It appears that some of the tests may be wrong or use different | ||
@@ -63,0 +62,0 @@ tailoring from the spec. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
2
2755
2
Yes
218833
3
7
63
1
+ Addedunicode-trie@2.0.0(transitive)
- Removedbrfs@^2.0.2
- Removedacorn@7.4.1(transitive)
- Removedacorn-node@1.8.2(transitive)
- Removedacorn-walk@7.2.0(transitive)
- Removedarray-from@2.1.1(transitive)
- Removedbrfs@2.0.2(transitive)
- Removedbuffer-equal@0.0.1(transitive)
- Removedbuffer-from@1.1.2(transitive)
- Removedconcat-stream@1.6.2(transitive)
- Removedconvert-source-map@1.9.0(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedd@1.0.2(transitive)
- Removeddash-ast@2.0.1(transitive)
- Removeddeep-is@0.1.4(transitive)
- Removedduplexer2@0.1.4(transitive)
- Removedes5-ext@0.10.64(transitive)
- Removedes6-iterator@2.0.3(transitive)
- Removedes6-map@0.1.5(transitive)
- Removedes6-set@0.1.6(transitive)
- Removedes6-symbol@3.1.4(transitive)
- Removedescodegen@1.14.32.1.0(transitive)
- Removedesniff@2.0.1(transitive)
- Removedesprima@4.0.1(transitive)
- Removedestraverse@4.3.05.3.0(transitive)
- Removedestree-is-function@1.0.0(transitive)
- Removedesutils@2.0.3(transitive)
- Removedevent-emitter@0.3.5(transitive)
- Removedext@1.7.0(transitive)
- Removedfast-levenshtein@2.0.6(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-assigned-identifiers@1.2.0(transitive)
- Removedhas@1.0.4(transitive)
- Removedhasown@2.0.2(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-core-module@2.15.1(transitive)
- Removedisarray@1.0.0(transitive)
- Removedlevn@0.3.0(transitive)
- Removedmagic-string@0.25.1(transitive)
- Removedmerge-source-map@1.0.4(transitive)
- Removedminimist@1.2.8(transitive)
- Removednext-tick@1.1.0(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedoptionator@0.8.3(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedprelude-ls@1.1.2(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedquote-stream@1.0.2(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedresolve@1.22.8(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedscope-analyzer@2.1.2(transitive)
- Removedshallow-copy@0.0.1(transitive)
- Removedsource-map@0.5.70.6.1(transitive)
- Removedsourcemap-codec@1.4.8(transitive)
- Removedstatic-eval@2.1.1(transitive)
- Removedstatic-module@3.0.4(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedthrough2@2.0.5(transitive)
- Removedtype@2.7.3(transitive)
- Removedtype-check@0.3.2(transitive)
- Removedtypedarray@0.0.6(transitive)
- Removedunicode-trie@1.0.0(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedword-wrap@1.2.5(transitive)
- Removedxtend@4.0.2(transitive)
Updatedunicode-trie@^2.0.0