{"_id":"@apify-scrapers/shared","name":"@apify-scrapers/shared","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@apify-scrapers/shared","version":"1.0.0","type":"module","description":"Shared utilities and constants for Apify scrapers","main":"src/index.js","exports":{".":"./src/index.js","./utils":"./src/utils/index.js","./constants":"./src/constants/index.js","./types":"./src/types/index.js"},"scripts":{"test":"jest","lint":"eslint src/","build":"echo 'No build step needed for shared module'"},"dependencies":{"csv-stringify":"^6.4.5"},"devDependencies":{"jest":"^29.0.0","eslint":"^8.0.0"},"keywords":["apify","scraper","ecommerce","shopee","lazada","web-scraping"],"author":{"name":"apify-ninnja"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/apify-ninnja/apify-scrapers.git"},"bugs":{"url":"https://github.com/apify-ninnja/apify-scrapers/issues"},"homepage":"https://github.com/apify-ninnja/apify-scrapers#readme","_id":"@apify-scrapers/shared@1.0.0","gitHead":"93d7080595b91ebade078b7c86eab6c6643996ad","_nodeVersion":"23.11.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-g+6VbFJgCpVVIheNzmPIgkJAMgyO7tHw6DAp+ouTGiB07VoHZFN9F0pNimJDfHatzg0+42TD5HG3cb+BzejU3Q==","shasum":"c30f72f065bd514c8c76e845c4119c74ba5cf4ca","tarball":"https://registry.npmjs.org/@apify-scrapers/shared/-/shared-1.0.0.tgz","fileCount":8,"unpackedSize":13438,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICtIN4v5R+Yzj85Fg2Khm2dVZInrDxuGD02uEGUV6lJrAiEAmuFB+203pIfjYi65q1d/08ucZVU0Y9drf2xx3yzlInk="}]},"_npmUser":{"name":"atlanlin","email":"ag.yelin@gmail.com"},"directories":{},"maintainers":[{"name":"atlanlin","email":"ag.yelin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/shared_1.0.0_1752750450385_0.9756859124305046"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-17T11:07:30.328Z","1.0.0":"2025-07-17T11:07:30.583Z","modified":"2025-07-17T11:07:30.864Z"},"maintainers":[{"name":"atlanlin","email":"ag.yelin@gmail.com"}],"description":"Shared utilities and constants for Apify scrapers","homepage":"https://github.com/apify-ninnja/apify-scrapers#readme","keywords":["apify","scraper","ecommerce","shopee","lazada","web-scraping"],"repository":{"type":"git","url":"git+https://github.com/apify-ninnja/apify-scrapers.git"},"author":{"name":"apify-ninnja"},"bugs":{"url":"https://github.com/apify-ninnja/apify-scrapers/issues"},"license":"MIT","readme":"# @apify-scrapers/shared\n\nShared utilities and constants for Apify e-commerce scrapers.\n\n## Installation\n\n```bash\nnpm install @apify-scrapers/shared\n```\n\n## Usage\n\n### Import utilities\n\n```javascript\nimport { \n    detectPlatform, \n    getNextPageUrl, \n    extractProductId, \n    normalizeProductUrl, \n    convertToCSV, \n    cleanProductData \n} from '@apify-scrapers/shared';\n```\n\n### Import constants\n\n```javascript\nimport { \n    PLATFORM_SELECTORS, \n    DEFAULT_CONFIG \n} from '@apify-scrapers/shared';\n```\n\n### Import specific modules\n\n```javascript\n// Import only utilities\nimport { convertToCSV } from '@apify-scrapers/shared/utils';\n\n// Import only constants\nimport { PLATFORM_SELECTORS } from '@apify-scrapers/shared/constants';\n```\n\n## API Reference\n\n### Utilities\n\n#### `detectPlatform(url)`\nDetects the e-commerce platform from a URL.\n\n#### `getNextPageUrl(url, pageNum, platform)`\nGenerates the next page URL for pagination.\n\n#### `extractProductId(productUrl)`\nExtracts product ID from a product URL.\n\n#### `normalizeProductUrl(productUrl, baseUrl)`\nNormalizes product URLs to absolute URLs.\n\n#### `convertToCSV(data, options)`\nConverts data array to CSV format.\n\n#### `cleanProductData(productData)`\nCleans and standardizes product data.\n\n### Constants\n\n#### `PLATFORM_SELECTORS`\nCSS selectors for different e-commerce platforms (Shopee, Lazada).\n\n#### `DEFAULT_CONFIG`\nDefault configuration for scrapers.\n\n## Supported Platforms\n\n- **Shopee**: Singapore, Malaysia, Indonesia, Philippines, Thailand, Vietnam\n- **Lazada**: Singapore, Malaysia, Indonesia, Philippines, Thailand, Vietnam\n\n## License\n\nMIT ","readmeFilename":"README.md","_rev":"1-8016199b062e88b1ebb975dd2fa4325d"}