{"_id":"@divyanshu1610/wiki-quotes","_rev":"1-3f34ced1eec3d1bf64089d283ebf81e6","name":"@divyanshu1610/wiki-quotes","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@divyanshu1610/wiki-quotes","version":"1.0.0","description":"[![Pipeline status][pipeline_badge]][pipeline_url] <!-- [![Published on NPM][npm_badge]][npm_url] -->","main":"dist/bundle.cjs.js","module":"dist/bundle.esm.js","scripts":{"test":"jest","test:watch":"jest --watch","test:coverage":"jest --coverage","prebuild":"rimraf dist","build":"rollup -c","lint":"eslint '**/*.js'","lint:fix":"npm run lint -- --fix","format":"prettier '**/*.js' --write"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.js":["npm run format"]},"keywords":["wikiquote","wiki","search","api","quote","quotes"],"repository":{"type":"git","url":"git+https://github.com/divyanshu1610/wiki-quotes.git"},"author":{"name":"Divyanshu Maurya","email":"divyanshu1610@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/divyanshu1610/wiki-quotes/issues"},"homepage":"https://github.com/divyanshu1610/wiki-quotes#readme","dependencies":{"axios":"^0.21.0","cheerio":"^1.0.0-rc.3"},"devDependencies":{"@babel/preset-env":"^7.12.1","@types/jest":"^26.0.15","babel-jest":"^26.6.3","eslint":"6.6.0","eslint-plugin-jest":"^24.1.0","husky":"^4.3.0","jest":"^26.6.3","lint-staged":"^10.5.1","prettier":"^2.1.2","prettier-eslint":"^11.0.0","prettier-eslint-cli":"^5.0.0","rimraf":"^3.0.2","rollup":"^2.33.1"},"gitHead":"1dc32c7a3d4a4af0caeb139bcc0187d791b5578a","_id":"@divyanshu1610/wiki-quotes@1.0.0","_nodeVersion":"15.1.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-QRXkQZKyELiK9AEo3jR3VteeTKzeG1no5oWdkIgecZMkNujun/GypNVrmJxXLbY5P/7bY74prVB1IUP3EF4mrg==","shasum":"e6045892312489c64d448e3aeff2ddc67a92d493","tarball":"https://registry.npmjs.org/@divyanshu1610/wiki-quotes/-/wiki-quotes-1.0.0.tgz","fileCount":5,"unpackedSize":18032,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfsnJ6CRA9TVsSAnZWagAAF4QP/22phcQ4xBvPeKvnGdcn\n4lUZz3srVxYEK29Anzm4TfLk6Uq7feLYG6Tn51FrMHQtlxjg4/42gauzG81Q\nBF2kvdJe3I7eIOpiMbu+J+XSVduY1fhSBgdSDhNow3v1uCGune/e0001WkF0\nvqEFM9NURg9mkqrctxub+9YOmDFXlk4uoWO3imm9EvqbQdWsXkR1hO+i+jB0\n8ytmlAaQ+l3DvZWwC8pFouch2VMrlBSrh5nyuNoFqaDMR9d9JYQjjoHzRmJe\nKQdUZFrDjshc5jXTDe/ki8BHPamVD/lOc/kHN9sOJitOilmkJA9MC1LKkP6K\nRRDKCmrxuRQxY2VvJGKQOpGhKIXSd/XQkY07LoZ70Er+F//zKba64HnHQQO3\n8CIwO6N+oTrCZP5MYsIUPU8HGWinVoOwGhmebFhOfR4JIugt6QOjve+//WF7\nIEHvhzdS8QPbfgFFftKlPga71lPiu3nR5wp2o9rjNqhoOK50QXwG/Oa9R7Do\n/wB8KUJ/jGRkfTS6nSrgCBesVpLrJgsbdg9FlAYpbzODm6TvPj1OsSojx22S\n/W0FxLkWG3MZevvtzGjLJKrM2OK9NPmtAro25Ks2CAX8Bji0z8HaLbLmeeeO\n+L7UJEcWiZovCyD8iItjGDt091TCXIexTk1LD3p8n6ucHTra61i/S96BhSsg\nwkFn\r\n=Rw3y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBaAkTOVbtYxgFmbtbhJ5HbMvde9f2zfnlF/vlpwlXO6AiBjz4AFoQi1aCCDxpcFiur2UE/zDyn13tbbehcpPLbTJA=="}]},"_npmUser":{"name":"divyanshu1610","email":"divyanshu1610@gmail.com"},"directories":{},"maintainers":[{"name":"divyanshu1610","email":"divyanshu1610@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/wiki-quotes_1.0.0_1605530234468_0.7389182625975927"},"_hasShrinkwrap":false}},"time":{"created":"2020-11-16T12:37:14.428Z","1.0.0":"2020-11-16T12:37:14.594Z","modified":"2022-04-05T04:48:56.099Z"},"maintainers":[{"name":"divyanshu1610","email":"divyanshu1610@gmail.com"}],"description":"[![Pipeline status][pipeline_badge]][pipeline_url] <!-- [![Published on NPM][npm_badge]][npm_url] -->","homepage":"https://github.com/divyanshu1610/wiki-quotes#readme","keywords":["wikiquote","wiki","search","api","quote","quotes"],"repository":{"type":"git","url":"git+https://github.com/divyanshu1610/wiki-quotes.git"},"author":{"name":"Divyanshu Maurya","email":"divyanshu1610@gmail.com"},"bugs":{"url":"https://github.com/divyanshu1610/wiki-quotes/issues"},"license":"MIT","readme":"# Wiki-Quotes\n\n[![Pipeline status][pipeline_badge]][pipeline_url]\n<!-- [![Published on NPM][npm_badge]][npm_url] -->\n\nAn API for [Wikiquote][wikiquote]\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Import library](#import-library)\n    - [ES2017 Module style](#es2017-module-style)\n      - [In Node](#in-node)\n    - [Old style](#old-style)\n      - [Old style in Node](#old-style-in-node)\n  - [API](#api)\n  - [Examples](#examples)\n    - [Get Random Quote](#get-random-quote)\n    - [Get Random Quote By Title](#get-random-quote-by-title)\n    - [More Examples][more_examples]\n- [Powered by Wikidata](#powered-by-wikidata)\n- [License](#license)\n\n## Installation\n\nWith [`NPM`][npm]\n\n```bash\nnpm install @divyanshu1610/wiki-quotes --save\n```\n\n## Usage\n\n### Import library\n\n#### ES2017 Module style\n\n##### In Node\n\n```javascript\nimport * as Wikiquotes from 'wiki-quotes'\n```\n\n#### Old style\n\n##### Old style in Node\n\n```javascript\nconst Wikiquotes = require('wiki-quotes')\n```\n\n### API\n\n`wiki-quotes` provides this functions\n\n```typescript\nfunction getRandomQuote(\n  titleList?: [string]\n): { title: string, quote: string }\n```\n> Note: If `titleList` is not provided a `defaultList` is used and a random quote by any one of them will be returned otherwise overrided by `titleList`.\n```typescript\nconst defaultList = [\n    'Mahatma Gandhi',\n    'Albert Einstein',\n    'Martin Luther King, Jr.',\n    'Leonardo da Vinci',\n    'Walt Disney',\n    'Edgar Allan Poe',\n    'Sigmund Freud',\n    'Thomas A. Edison',\n    'Robin Williams',\n    'Steve Jobs',\n  ]\n\n```\n\n\n```typescript\nfunction getRandomQuoteByTitle(\n  titleName: string\n): { title: titleName, quote: string }\n\n```\n\n\n\n### Examples\n\n> #### Get Random Quote\n\n```javascript\n// returns a promise that resolve with quote and it's person's name as title.\nWikiquoteApi.getRandomQuote().then(console.log)\n// Output:\n{\n  title: 'Robin Williams',\n  quote: 'Look! The moon like a testicle hangs low in the sky. This bodes not well.'\n}\n```\n\n> #### Get Random Quote By Title\n\n```javascript\n// returns a promise that resolve with quote and it's person's name as title.\nWikiquoteApi.getRandomQuoteByTitle('Mahatma Gandhi').then(console.log)\n// Output:\n{\n  title: 'Mahatma Gandhi',\n  quote: 'Good government is no substitute for self-government.'\n}\n```\n\n## Powered by Wikidata\n\nDon't forget to add `Powered by Wikidata` to your project\n\n## License\n\n[MIT][license]\n\n[pipeline_badge]: https://github.com/divyanshu1610/wiki-quotes/workflows/%F0%9F%9B%A0%20Build/badge.svg?branch=main\n[pipeline_url]: https://github.com/divyanshu1610/wiki-quotes/workflows/%F0%9F%9B%A0%20Build/badge.svg?branch=main\n<!-- [npm_badge]: -->\n<!-- [npm_url]:  -->\n[wikiquote]: https://www.wikiquote.org\n[npm]: https://www.npmjs.com\n[more_examples]: https://github.com/divyanshu1610/wiki-quotes/tree/main/examples\n[license]: https://github.com/divyanshu1610/wiki-quotes/blob/main/LICENSE\n","readmeFilename":"README.md"}