tiktok-live-api 1.2.6 → 1.2.7
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/bin/demo.mjs +46 -56
- package/package.json +1 -1
package/bin/demo.mjs
CHANGED
|
@@ -262,7 +262,7 @@ function runScaffold(choice, targetDir, pm) {
|
|
|
262
262
|
|
|
263
263
|
try {
|
|
264
264
|
if (isNuxt) {
|
|
265
|
-
execSync(npxCmd + '
|
|
265
|
+
execSync(npxCmd + ' degit tiktool/tiktok-live-nuxt "' + targetDir + '"', { stdio: 'inherit' });
|
|
266
266
|
} else if (isNext) {
|
|
267
267
|
execSync(npxCmd + ' create-next-app@latest "' + targetDir + '" --js --eslint --tailwind --app --src-dir --import-alias "@/*" --use-' + pm, { stdio: 'inherit' });
|
|
268
268
|
} else if (isVite) {
|
|
@@ -270,62 +270,52 @@ function runScaffold(choice, targetDir, pm) {
|
|
|
270
270
|
execSync(createCmd + ' "' + targetDir + '" -- --template react', { stdio: 'inherit' });
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
-
console.log("\n " + B + "📦 Installing " + C.cyan + "tiktok-live-api" + B + " SDK..." + R + "\n");
|
|
274
|
-
execSync(installCmd, { cwd: fullPath, stdio: 'inherit' });
|
|
275
|
-
|
|
276
273
|
if (isNuxt) {
|
|
277
|
-
|
|
278
|
-
const
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
'
|
|
288
|
-
|
|
289
|
-
'
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
" return (",
|
|
323
|
-
' <main style={{ minHeight: "100vh", background: "#f9fafb", paddingTop: "40px" }}>',
|
|
324
|
-
" <TikTokLive />",
|
|
325
|
-
" </main>",
|
|
326
|
-
" );",
|
|
327
|
-
"}"
|
|
328
|
-
].join('\n') + '\n');
|
|
274
|
+
console.log("\\n " + B + "📦 Installing dependencies using " + pm + "..." + R + "\\n");
|
|
275
|
+
const installAllCmd = pm === 'npm' ? 'npm install' : pm === 'yarn' ? 'yarn' : pm === 'pnpm' ? 'pnpm install' : 'bun install';
|
|
276
|
+
execSync(installAllCmd, { cwd: fullPath, stdio: 'inherit' });
|
|
277
|
+
} else {
|
|
278
|
+
console.log("\\n " + B + "📦 Installing " + C.cyan + "tiktok-live-api" + B + " SDK..." + R + "\\n");
|
|
279
|
+
execSync(installCmd, { cwd: fullPath, stdio: 'inherit' });
|
|
280
|
+
|
|
281
|
+
if (isNext) {
|
|
282
|
+
const compDir = path.join(fullPath, 'src', 'components');
|
|
283
|
+
if (!fs.existsSync(compDir)) fs.mkdirSync(compDir, { recursive: true });
|
|
284
|
+
fs.writeFileSync(path.join(compDir, 'TikTokLive.jsx'), REACT_TEMPLATE);
|
|
285
|
+
|
|
286
|
+
const pageJs = path.join(fullPath, 'src', 'app', 'page.js');
|
|
287
|
+
if (fs.existsSync(pageJs)) {
|
|
288
|
+
fs.writeFileSync(pageJs, [
|
|
289
|
+
"import TikTokLive from '@/components/TikTokLive';",
|
|
290
|
+
"",
|
|
291
|
+
"export default function Home() {",
|
|
292
|
+
" return (",
|
|
293
|
+
' <main style={{ minHeight: "100vh", background: "#f9fafb", paddingTop: "40px" }}>',
|
|
294
|
+
" <TikTokLive />",
|
|
295
|
+
" </main>",
|
|
296
|
+
" );",
|
|
297
|
+
"}"
|
|
298
|
+
].join('\n') + '\n');
|
|
299
|
+
}
|
|
300
|
+
} else if (isVite) {
|
|
301
|
+
const compDir = path.join(fullPath, 'src', 'components');
|
|
302
|
+
if (!fs.existsSync(compDir)) fs.mkdirSync(compDir, { recursive: true });
|
|
303
|
+
fs.writeFileSync(path.join(compDir, 'TikTokLive.jsx'), REACT_TEMPLATE);
|
|
304
|
+
|
|
305
|
+
const appJsx = path.join(fullPath, 'src', 'App.jsx');
|
|
306
|
+
if (fs.existsSync(appJsx)) {
|
|
307
|
+
fs.writeFileSync(appJsx, [
|
|
308
|
+
"import TikTokLive from './components/TikTokLive';",
|
|
309
|
+
"",
|
|
310
|
+
"export default function App() {",
|
|
311
|
+
" return (",
|
|
312
|
+
' <main style={{ minHeight: "100vh", background: "#f9fafb", paddingTop: "40px" }}>',
|
|
313
|
+
" <TikTokLive />",
|
|
314
|
+
" </main>",
|
|
315
|
+
" );",
|
|
316
|
+
"}"
|
|
317
|
+
].join('\n') + '\n');
|
|
318
|
+
}
|
|
329
319
|
}
|
|
330
320
|
}
|
|
331
321
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tiktok-live-api",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7",
|
|
4
4
|
"description": "Unofficial TikTok LIVE API Client — Real-time chat, gifts, viewers, battles, and AI live captions from any TikTok livestream. Managed WebSocket API with 99.9% uptime.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|