@gosavetool /文本
没有依赖的小文本助手:单词和字符计数,阅读时间,社交媒体字符限制,大小写更改,URL标记和空白清理。
由 GoSaveTool. 不需要代码吗?试 字符计数器.
安装
npm install @gosavetool/text
计数和阅读时间
const { stats } = require('@gosavetool/text');
stats('Hello world. It’s 2026!');
// { words: 4, chars: 23, charsNoSpaces: 20, lines: 1, sentences: 2, readSeconds: 1 }
阅读时间为每分钟238个单词,这是非小说类读物的平均默读速度。
社交媒体和SEO限制
const { limits } = require('@gosavetool/text');
limits(caption, ['x-post', 'instagram-caption']);
// { 'x-post': { limit: 280, used: 312, left: -32, fits: false }, 'instagram-caption': { … fits: true } }
| 名字 | 限制 |
|---|---|
x-post | 280 |
instagram-caption | 2200年 |
tiktok-caption | 4000年 |
youtube-title | 100 |
youtube-description | 5000年 |
linkedin-post | 3,000 |
pinterest-description | 500 |
seo-title | 60 |
meta-description | 160 |
套管和段塞
const t = require('@gosavetool/text');
t.title('the lord of the rings: return of the king'); // 'The Lord of the Rings: Return of the King'
t.sentence('HELLO WORLD. how ARE you?'); // 'Hello world. How are you?'
t.slug('Ölçü Birimi & Çeviri!'); // 'olcu-birimi-ceviri'
t.camel('best posting time'); // 'bestPostingTime'
t.snake('bestPostingTime'); // 'best_posting_time'
t.kebab('Best Posting_Time'); // 'best-posting-time'
t.clean('a b \n\n\n\nc'); // 'a b\n\nc'
slug() 将土耳其语(' ',' ',' ‘ ‘,ç, ö, ü),德语(’ ’)和重音字母转换为纯ASCII。
包括TypeScript类型。
相关
- 酷文本生成器: bios的花哨的Unicode字体
- @gosavetool /字幕: SRT和WebVTT工具
- VS代码: GoSaveTool扩展,状态栏中的字数统计
许可证
麻省理工学院