@0xsharon/synco 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 0xSHARON
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
package/README.md CHANGED
@@ -1,3 +1,183 @@
1
- # Temporary Holding Version
1
+ # @0xsharon/synco
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > Get time-synchronized LRC format lyrics for your music in Node.js and CLI.
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@0xsharon/synco.svg)](https://www.npmjs.com/package/@0xsharon/synco)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ A fast, lightweight, and modern Node.js library and command-line tool that searches and downloads synchronized lyrics (`.lrc` files) from multiple online lyrics providers.
9
+
10
+ ---
11
+
12
+ ## ✨ Features
13
+
14
+ - **⏱️ Synchronized (.lrc) Support:** Retrieves time-stamped lyrics ready for any music player or karaoke system.
15
+ - **📄 Plaintext & Synced Modes:** Easily choose between synchronized (`--synced-only`) or plaintext (`--plain-only`) lyrics.
16
+ - **🎤 Enhanced Word-by-Word Lyrics:** Supports word-level karaoke timing tags (`<mm:ss.xx>`) when available.
17
+ - **🌐 Translations:** Retrieve translated lyrics alongside original lines.
18
+ - **🔍 Intelligent Fallback & Fuzzy Matching:** Uses token set ratio similarity algorithms to accurately match tracks and filter out extraneous results.
19
+ - **⚡ Dual ESM & CommonJS:** Native support for both `import` and `require()`, complete with TypeScript declarations.
20
+ - **💻 CLI & Programmatic API:** Use directly from your terminal or integrate seamlessly into your Node.js apps.
21
+
22
+ ---
23
+
24
+ ## 📦 Installation
25
+
26
+ ### Global CLI
27
+ ```bash
28
+ npm install -g @0xsharon/synco
29
+ ```
30
+ Or run directly with `npx`:
31
+ ```bash
32
+ npx @0xsharon/synco "SEARCH_TERM"
33
+ ```
34
+
35
+ ### Local Project Dependency
36
+ ```bash
37
+ npm install @0xsharon/synco
38
+ ```
39
+ ```bash
40
+ pnpm add @0xsharon/synco
41
+ ```
42
+ ```bash
43
+ yarn add @0xsharon/synco
44
+ ```
45
+
46
+ ---
47
+
48
+ ## 🚀 CLI Usage
49
+
50
+ ```bash
51
+ synco "SEARCH_TERM" [options]
52
+ ```
53
+ *(Also available as `syncedlyrics` alias)*
54
+
55
+ ### Examples:
56
+ ```bash
57
+ # Basic search (downloads to "{search_term}.lrc" by default)
58
+ synco "Bohemian Rhapsody Queen"
59
+
60
+ # Save to a custom file
61
+ synco "Blinding Lights The Weeknd" -o "blinding_lights.lrc"
62
+
63
+ # Search specific providers only
64
+ synco "bad guy billie eilish" -p lrclib megalobiz
65
+
66
+ # Get plaintext lyrics only
67
+ synco "Shape of You Ed Sheeran" --plain-only
68
+
69
+ # Enhanced word-by-word karaoke format
70
+ synco "Shape of You Ed Sheeran" --enhanced
71
+
72
+ # Enable verbose debug logs
73
+ synco "Hotel California Eagles" -v
74
+ ```
75
+
76
+ ### Options
77
+
78
+ | Flag | Short | Description | Default |
79
+ | --- | --- | --- | --- |
80
+ | `--output <path>` | `-o` | Output file path (`{search_term}` is replaced dynamically) | `"{search_term}.lrc"` |
81
+ | `--providers <list>` | `-p` | Space-separated list of providers to search | *all available* |
82
+ | `--lang <code>` | `-l` | Translation language code (e.g., `es`, `de`, `fr`) | `undefined` |
83
+ | `--plain-only` | | Only look for plain text (not synced) lyrics | `false` |
84
+ | `--synced-only` | | Only look for synced lyrics | `false` |
85
+ | `--enhanced` | | Word-by-word karaoke synchronized lyrics | `false` |
86
+ | `--token <token>` | | Optional custom Musixmatch user token | `undefined` |
87
+ | `--verbose` | `-v` | Output debug logs to stderr | `false` |
88
+ | `--version` | `-V` | Output version number | |
89
+ | `--help` | `-h` | Display help screen | |
90
+
91
+ ---
92
+
93
+ ## 🛠️ Programmatic Usage (Node.js & TypeScript)
94
+
95
+ ### TypeScript / ES Modules (`import`)
96
+ ```typescript
97
+ import synco, { search } from '@0xsharon/synco';
98
+
99
+ // Simple search
100
+ const lrc = await search('Bohemian Rhapsody Queen');
101
+ console.log(lrc);
102
+
103
+ // Or call the default export directly
104
+ const lrcText = await synco('Hotel California Eagles');
105
+ ```
106
+
107
+ ### CommonJS (`require`)
108
+ ```javascript
109
+ const synco = require('@0xsharon/synco');
110
+
111
+ async function main() {
112
+ const lrc = await synco.search('Blinding Lights The Weeknd');
113
+ console.log(lrc);
114
+ }
115
+ main();
116
+ ```
117
+
118
+ ### Advanced Options
119
+
120
+ ```typescript
121
+ import { search } from '@0xsharon/synco';
122
+
123
+ const lrc = await search('bad guy billie eilish', {
124
+ // Only search specific providers
125
+ providers: ['lrclib', 'megalobiz'],
126
+
127
+ // Only return synchronized lyrics (or plain-only)
128
+ syncedOnly: true,
129
+
130
+ // Automatically save to disk ({search_term} placeholder supported)
131
+ savePath: './lyrics/{search_term}.lrc',
132
+
133
+ // Word-level karaoke timing
134
+ enhanced: false,
135
+
136
+ // Request timeout in milliseconds
137
+ timeoutMs: 8000,
138
+
139
+ // Enable debug logging
140
+ verbose: true,
141
+ });
142
+ ```
143
+
144
+ ### Helper Utilities Exported
145
+ ```typescript
146
+ import {
147
+ syncedToPlaintext,
148
+ identifyLyricsType,
149
+ formatTime,
150
+ strScore,
151
+ Lyrics,
152
+ TargetType,
153
+ } from 'synco';
154
+
155
+ // Convert synced LRC to clean plaintext
156
+ const plain = syncedToPlaintext(lrc);
157
+
158
+ // Check if string contains synchronized timestamps
159
+ const type = identifyLyricsType(lrc); // 'synced' | 'plaintext' | 'invalid'
160
+
161
+ // Format seconds into [mm:ss.xx]
162
+ console.log(formatTime(75.5)); // "01:15.50"
163
+ ```
164
+
165
+ ---
166
+
167
+ ## 📡 Providers
168
+
169
+ | Provider | Status | Synced | Word-by-Word | Translations |
170
+ | --- | :---: | :---: | :---: | :---: |
171
+ | **LRCLIB** (`lrclib`) | ✅ Operational | Yes | No | No |
172
+ | **Megalobiz** (`megalobiz`) | ✅ Operational | Yes | No | No |
173
+ | **Musixmatch** (`musixmatch`) | ✅ Operational | Yes | Yes | Yes |
174
+ | **NetEase** (`netease`) | ✅ Operational | Yes | No | No |
175
+ | **Genius** (`genius`) | ✅ Operational | Plaintext | No | No |
176
+ | **Deezer** (`deezer`) | ⚠️ Fallback | Yes | No | No |
177
+ | **Lyricsify** (`lyricsify`) | ⚠️ Fallback | Yes | No | No |
178
+
179
+ ---
180
+
181
+ ## 📄 License
182
+
183
+ MIT License © 2026 [0xSHARON](https://github.com/0xSHARON)