{"_id":"@667/socialitejs","_rev":"2-f88459ce9a4efe269f749e7d9c0f5c27","name":"@667/socialitejs","dist-tags":{"latest":"0.0.6-2"},"versions":{"0.0.6":{"name":"@667/socialitejs","version":"0.0.6","description":"Social network URL parsing for aristocrats","author":{"name":"Curtis Dulmage"},"license":"ISC","keywords":["social","network","parse","url","user","handle","profile"],"homepage":"https://github.com/beefchimi/socialite#readme","bugs":{"url":"https://github.com/beefchimi/socialite/issues"},"repository":{"type":"git","url":"git+https://github.com/beefchimi/socialite.git"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"type":"module","main":"./dist/socialite.umd.js","module":"./dist/socialite.es.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/socialite.es.js","require":"./dist/socialite.umd.js","types":"./dist/index.d.ts"}},"engines":{"node":">=20.10.0","npm":">=10.2.0"},"scripts":{"clean":"rm -rf coverage && rm -rf dist","nuke":"npm run clean && rm -rf node_modules && rm -rf package-lock.json && npm cache clean --force","build":"npm run clean && tsc && vite build","lint":"eslint . --ext .ts","lint:fix":"npm run lint -- --fix","format":"prettier --check .","format:fix":"prettier --write .","test":"vitest","test:ui":"vitest --ui","coverage":"vitest --run --coverage","report":"changeset","release":"npm run build && changeset publish"},"devDependencies":{"@changesets/cli":"^2.27.1","@types/node":"^20.11.19","@typescript-eslint/eslint-plugin":"^6.21.0","@vitest/coverage-v8":"^1.2.2","@vitest/ui":"^1.2.2","eslint":"^8.56.0","eslint-config-prettier":"^9.1.0","eslint-config-standard-with-typescript":"^43.0.1","eslint-plugin-import":"^2.29.1","eslint-plugin-n":"^16.6.2","eslint-plugin-prettier":"^5.1.3","eslint-plugin-promise":"^6.1.1","prettier":"^3.2.5","typescript":"^5.3.3","vite":"^5.1.3","vite-plugin-dts":"^3.7.2","vitest":"^1.2.2"},"_id":"@667/socialitejs@0.0.6","gitHead":"b8e95bf9235f60e06e9d951908b23eb3084b1f3c","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-60h0M8yzfghQgq1CewNtFQ8DPRvsb6LbcS22cyHIVMsPvslk49DNitMILzc7wr05gXITjnlcrjgHTQoTJTp7ZQ==","shasum":"2a563a3fe4e765dec702aade73f58ac24c653017","tarball":"https://registry.npmjs.org/@667/socialitejs/-/socialitejs-0.0.6.tgz","fileCount":3,"unpackedSize":5746,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEZr4RQmlTJEut8Rkj//K11InrxTzvLg2s2zPdrEeV7JAiBiPJdHnTpbhaVQY/r9YjRo6ZBlOfig9GUal1uw8T+uRg=="}]},"_npmUser":{"name":"667","email":"667@june07.com"},"directories":{},"maintainers":[{"name":"667","email":"667@june07.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/socialitejs_0.0.6_1712792932245_0.23108283356020198"},"_hasShrinkwrap":false},"0.0.6-1":{"name":"@667/socialitejs","version":"0.0.6-1","description":"Social network URL parsing for aristocrats","author":{"name":"Curtis Dulmage"},"license":"ISC","keywords":["social","network","parse","url","user","handle","profile"],"homepage":"https://github.com/beefchimi/socialite#readme","bugs":{"url":"https://github.com/beefchimi/socialite/issues"},"repository":{"type":"git","url":"git+https://github.com/beefchimi/socialite.git"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"type":"module","main":"./dist/socialite.umd.js","module":"./dist/socialite.es.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/socialite.es.js","require":"./dist/socialite.umd.js","types":"./dist/index.d.ts"}},"engines":{"node":">=20.10.0","npm":">=10.2.0"},"scripts":{"clean":"rm -rf coverage && rm -rf dist","nuke":"npm run clean && rm -rf node_modules && rm -rf package-lock.json && npm cache clean --force","build":"npm run clean && tsc && vite build","lint":"eslint . --ext .ts","lint:fix":"npm run lint -- --fix","format":"prettier --check .","format:fix":"prettier --write .","test":"vitest","test:ui":"vitest --ui","coverage":"vitest --run --coverage","report":"changeset","release":"npm run build && changeset publish"},"devDependencies":{"@changesets/cli":"^2.27.1","@types/node":"^20.11.19","@typescript-eslint/eslint-plugin":"^6.21.0","@vitest/coverage-v8":"^1.2.2","@vitest/ui":"^1.2.2","eslint":"^8.56.0","eslint-config-prettier":"^9.1.0","eslint-config-standard-with-typescript":"^43.0.1","eslint-plugin-import":"^2.29.1","eslint-plugin-n":"^16.6.2","eslint-plugin-prettier":"^5.1.3","eslint-plugin-promise":"^6.1.1","prettier":"^3.2.5","typescript":"^5.3.3","vite":"^5.1.3","vite-plugin-dts":"^3.7.2","vitest":"^1.2.2"},"_id":"@667/socialitejs@0.0.6-1","gitHead":"b8e95bf9235f60e06e9d951908b23eb3084b1f3c","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-xnWJfDvh9tD0iLe4RcpkVUQ3JpEr8bZpmYHPH8qkM+glRGByP0w60TVG+kSwoKp6zISBPf99r5Ns0dlO25tHqg==","shasum":"f5a584bbae00c5fcbc17b484915a19e5e920b86f","tarball":"https://registry.npmjs.org/@667/socialitejs/-/socialitejs-0.0.6-1.tgz","fileCount":6,"unpackedSize":43792,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID5DCRK4YV8NKg0Nns/ztsQYgu5VtGI59Vx9m5sIgc0EAiB546493tf2grwnyU0SRzEbIaMaUHIs0Un3Y9JJFAVdXQ=="}]},"_npmUser":{"name":"667","email":"667@june07.com"},"directories":{},"maintainers":[{"name":"667","email":"667@june07.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/socialitejs_0.0.6-1_1712793285246_0.5514669242753572"},"_hasShrinkwrap":false},"0.0.6-2":{"name":"@667/socialitejs","version":"0.0.6-2","description":"Social network URL parsing for aristocrats","author":{"name":"Curtis Dulmage"},"license":"ISC","keywords":["social","network","parse","url","user","handle","profile"],"homepage":"https://github.com/beefchimi/socialite#readme","bugs":{"url":"https://github.com/beefchimi/socialite/issues"},"repository":{"type":"git","url":"git+https://github.com/beefchimi/socialite.git"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"type":"module","main":"./dist/socialite.umd.js","module":"./dist/socialite.es.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/socialite.es.js","require":"./dist/socialite.umd.js","types":"./dist/index.d.ts"}},"engines":{"node":">=20.10.0","npm":">=10.2.0"},"scripts":{"clean":"rm -rf coverage && rm -rf dist","nuke":"npm run clean && rm -rf node_modules && rm -rf package-lock.json && npm cache clean --force","build":"npm run clean && tsc && vite build","lint":"eslint . --ext .ts","lint:fix":"npm run lint -- --fix","format":"prettier --check .","format:fix":"prettier --write .","test":"vitest","test:ui":"vitest --ui","coverage":"vitest --run --coverage","report":"changeset","release":"npm run build && changeset publish"},"devDependencies":{"@changesets/cli":"^2.27.1","@types/node":"^20.11.19","@typescript-eslint/eslint-plugin":"^6.21.0","@vitest/coverage-v8":"^1.2.2","@vitest/ui":"^1.2.2","eslint":"^8.56.0","eslint-config-prettier":"^9.1.0","eslint-config-standard-with-typescript":"^43.0.1","eslint-plugin-import":"^2.29.1","eslint-plugin-n":"^16.6.2","eslint-plugin-prettier":"^5.1.3","eslint-plugin-promise":"^6.1.1","prettier":"^3.2.5","typescript":"^5.3.3","vite":"^5.1.3","vite-plugin-dts":"^3.7.2","vitest":"^1.2.2"},"_id":"@667/socialitejs@0.0.6-2","gitHead":"b8e95bf9235f60e06e9d951908b23eb3084b1f3c","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-Wqbzg2iYx0lcrfr5tLO/CS8OXifhfLErAVrlEqM6GmRNL9ZFHeabnnEM2iMwlVyGxSySJHFwwu5qjpJQlygZ7A==","shasum":"8d6a7c806382d480e2553982cf9d7ab1f700d2bd","tarball":"https://registry.npmjs.org/@667/socialitejs/-/socialitejs-0.0.6-2.tgz","fileCount":6,"unpackedSize":43818,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBgmCijWfcvNNV74/F0f6bKMltr5qn3MrmJc90BzX6+OAiEA8grIRlgt9MXSqzPMLkAcjbUBRuYCcEeBN80D4PoyX4E="}]},"_npmUser":{"name":"667","email":"667@june07.com"},"directories":{},"maintainers":[{"name":"667","email":"667@june07.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/socialitejs_0.0.6-2_1712795152564_0.3756309819932111"},"_hasShrinkwrap":false}},"time":{"created":"2024-04-10T23:48:52.168Z","0.0.6":"2024-04-10T23:48:52.393Z","modified":"2024-04-11T00:25:52.905Z","0.0.6-1":"2024-04-10T23:54:45.421Z","0.0.6-2":"2024-04-11T00:25:52.722Z"},"maintainers":[{"name":"667","email":"667@june07.com"}],"description":"Social network URL parsing for aristocrats","homepage":"https://github.com/beefchimi/socialite#readme","keywords":["social","network","parse","url","user","handle","profile"],"repository":{"type":"git","url":"git+https://github.com/beefchimi/socialite.git"},"author":{"name":"Curtis Dulmage"},"bugs":{"url":"https://github.com/beefchimi/socialite/issues"},"license":"ISC","readme":"# Socialite\n\n[![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)\n\n`Socialite` is a quick and easy way to parse a `url: string` to determine:\n\n1. What social network it belongs to.\n2. What the `user` handle is.\n3. What the social `prefix` is _(if relevant)_.\n4. What each url segment is, broken up into groups.\n\nThe minimum criteria for parsing a `url` is:\n\n1. **domain**: `https://www.{{domain}}.com/path`\n2. **tldomain**: `https://www.domain{{.com}}/path`\n\n## Installation\n\nSimply install via the command-line or include in your `package.json`, just like any other dependency.\n\n```sh\n# Alternatively install with `yarn` or `pnpm`\nnpm install socialitejs\n```\n\n## How to use\n\nBy default, `Socialite` includes only a small collection of the most common social networks. The exact networks included can be found in the `defaultSocialiteNetworks` array. A typical use case looks like:\n\n```ts\nimport {Socialite} from 'socialitejs';\n\nconst socialiteInstance = new Socialite();\nconst mySocialUrl = 'https://www.twitter.com/@SomeFakeUserHandle';\nconst parsedSocialUrl = socialiteInstance.parseProfile(mySocialUrl);\n\nconsole.log(parsedSocialUrl);\n```\n\nThe above will log the following `SocialiteProfile` _(object)_ to the console:\n\n```ts\n{\n  id: 'twitter',\n  prefix: '@',\n  user: 'SomeFakeUserHandle',\n  originalUrl: 'https://www.twitter.com/@SomeFakeUserHandle',\n  preferredUrl: 'https://twitter.com/@SomeFakeUserHandle',\n  appUrl: 'https://mobile.twitter.com/@SomeFakeUserHandle',\n  urlGroups: {\n    scheme: 'https://',\n    subdomain: 'www.',\n    domain: 'twitter',\n    tldomain: '.com',\n    path: '/@SomeFakeUserHandle',\n    // Other url parts are omitted if `undefined`\n  },\n}\n```\n\nFor a more robust collection of social networks, you can import the `socialiteNetworks` object and use it _(at least)_ one of two ways:\n\n```ts\nimport {Socialite, socialiteNetworks, type SocialiteId} from 'socialitejs';\n\n// Adding all social networks in bulk:\nconst allNetworksInstance = new Socialite(Object.values(socialiteNetworks));\n\n// Logs to the console all social networks included in the code base.\nconsole.log(allNetworksInstance.getAllNetworks());\n\n// Initializing `Socialite` without any networks (pass empty `array`):\nconst selectiveNetworksInstance = new Socialite([]);\nconst excludedNetworks: SocialiteId[] = ['discord', 'facebook', 'reddit'];\n\nObject.keys(socialiteNetworks).forEach((network) => {\n  if (!excludedNetworks.includes(network.id)) {\n    selectiveNetworksInstance.addNetwork(network);\n  }\n});\n\n// Logs to the console all social networks not found in `excludedNetworks`.\nconsole.log(selectiveNetworksInstance.getAllNetworks());\n```\n\n## Features\n\n...this section is incomplete... check back later for API documentation.\n","readmeFilename":"README.md"}