mirror of
https://github.com/vitalygashkov/crextractor.git
synced 2026-07-15 17:40:03 +02:00
refactor: migrate to esm
This commit is contained in:
+2
-2
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const { parseArgs } = require('node:util');
|
||||
const { extract } = require('../crextractor');
|
||||
import { parseArgs } from 'node:util';
|
||||
import { extract } from '../crextractor.js';
|
||||
|
||||
const args = parseArgs({
|
||||
options: {
|
||||
|
||||
+8
-7
@@ -1,8 +1,8 @@
|
||||
const { execSync } = require('node:child_process');
|
||||
const { join } = require('node:path');
|
||||
const { readdir, readFile, writeFile, rm } = require('node:fs/promises');
|
||||
const { existsSync } = require('node:fs');
|
||||
const { download } = require('molnia');
|
||||
import { execSync } from 'node:child_process';
|
||||
import { join } from 'node:path';
|
||||
import { readdir, readFile, writeFile, rm } from 'node:fs/promises';
|
||||
import { existsSync } from 'node:fs';
|
||||
import { download } from 'molnia';
|
||||
|
||||
const downloadMobileApk = async () => {
|
||||
const url = 'https://api.qqaoop.com/v11/apps/com.crunchyroll.crunchyroid/download?userId=1';
|
||||
@@ -103,7 +103,8 @@ const parseVersion = async (decompiledDir) => {
|
||||
const manifestJsonPath = join(decompiledDir, 'resources', 'manifest.json');
|
||||
const manifestXmlPath = join(decompiledDir, 'resources', 'AndroidManifest.xml');
|
||||
if (existsSync(manifestJsonPath)) {
|
||||
const manifest = require(manifestJsonPath);
|
||||
const manifestContent = await readFile(manifestJsonPath, 'utf8');
|
||||
const manifest = JSON.parse(manifestContent);
|
||||
const version = `${manifest.version_name} (${manifest.version_code})`;
|
||||
return version;
|
||||
} else if (existsSync(manifestXmlPath)) {
|
||||
@@ -159,4 +160,4 @@ const pull = async ({ target = 'mobile' } = {}) => {
|
||||
return credentials;
|
||||
};
|
||||
|
||||
module.exports = { extract, pull };
|
||||
export { extract, pull };
|
||||
|
||||
Generated
+1
-1
@@ -25,7 +25,7 @@
|
||||
"typescript": "^5.9.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
"node": ">=24"
|
||||
}
|
||||
},
|
||||
"node_modules/@oxfmt/darwin-arm64": {
|
||||
|
||||
+9
-2
@@ -29,9 +29,16 @@
|
||||
"crextractor.d.ts",
|
||||
"crextractor.js"
|
||||
],
|
||||
"type": "commonjs",
|
||||
"type": "module",
|
||||
"main": "crextractor.js",
|
||||
"types": "crextractor.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./crextractor.d.ts",
|
||||
"import": "./crextractor.js",
|
||||
"require": "./crextractor.js"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"start": "node bin/cli.js",
|
||||
"extract:mobile": "node bin/cli.js --target mobile --output ./credentials.mobile.json",
|
||||
@@ -46,7 +53,7 @@
|
||||
"typescript": "^5.9.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
"node": ">=24"
|
||||
},
|
||||
"readmeFilename": "README.md"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user