Socket
Socket
Sign inDemoInstall

string-length

Package Overview
Dependencies
3
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 3.0.0

index.d.ts

5

index.js

@@ -5,2 +5,5 @@ 'use strict';

module.exports = input => stripAnsi(input).replace(astralRegex(), ' ').length;
const stringLength = string => stripAnsi(string).replace(astralRegex(), ' ').length;
module.exports = stringLength;
module.exports.default = stringLength;

84

package.json
{
"name": "string-length",
"version": "2.0.0",
"description": "Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes",
"license": "MIT",
"repository": "sindresorhus/string-length",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"unicode",
"string",
"length",
"size",
"count",
"astral",
"symbol",
"surrogates",
"codepoints",
"ansi",
"escape",
"codes"
],
"dependencies": {
"astral-regex": "^1.0.0",
"strip-ansi": "^4.0.0"
},
"devDependencies": {
"ava": "*",
"xo": "*"
}
"name": "string-length",
"version": "3.0.0",
"description": "Get the real length of a string - by correctly counting astral symbols and ignoring ansi escape codes",
"license": "MIT",
"repository": "sindresorhus/string-length",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd-check"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"unicode",
"string",
"length",
"size",
"count",
"astral",
"symbol",
"surrogates",
"codepoints",
"ansi",
"escape",
"codes"
],
"dependencies": {
"astral-regex": "^1.0.0",
"strip-ansi": "^5.1.0"
},
"devDependencies": {
"ava": "^1.3.1",
"tsd-check": "^0.5.0",
"xo": "^0.24.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc