{"_id":"sentencer","_rev":"20-06be771421548dedf43f80a9255f754e","name":"sentencer","description":"Sentencer is a string templating engine for madlibs-style sentence generating.","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.1":{"name":"sentencer","version":"0.1.1","description":"Sentencer is a string templating engine for madlibs-style sentence generating.","scripts":{"start":"node index.js","test":"gulp test"},"dependencies":{"lodash":"~2.4.1","natural":"~0.1.28","articles":"~0.2.1","randy":"~1.5.1"},"devDependencies":{"gulp":"~3.8.8","gulp-mocha":"~1.1.0"},"main":"index.js","keywords":["sentences","sentence","random","madlibs","metaphorpsum"],"author":{"name":"Kyle Stetz"},"license":"MIT","gitHead":"07a30c0efadcfae3eb77f13bc73082957bcefd2a","_id":"sentencer@0.1.1","_shasum":"68bdb99012ea5eaa63ee65636eea7a0a164349ec","_from":".","_npmVersion":"1.4.24","_npmUser":{"name":"kylestetz","email":"kylestetz@gmail.com"},"maintainers":[{"name":"kylestetz","email":"kylestetz@gmail.com"}],"dist":{"shasum":"68bdb99012ea5eaa63ee65636eea7a0a164349ec","tarball":"https://registry.npmjs.org/sentencer/-/sentencer-0.1.1.tgz","integrity":"sha512-736s3/l5j3aVJOAe8pt3YNt2u3WS8ItWVfuoHv+lF1HRDCCHUA+2ErCoeEDT/oQQGJrpMeKiovyXKzASX+t7Tw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICQm6ifHG6b+c2oi7CizyK/p8wFUO4o129W6q6zHB2ffAiBels2pC5714E3GRfZwQ3coj9VGpFtn0miqmjeTsEQnpQ=="}]},"directories":{}},"0.1.2":{"name":"sentencer","version":"0.1.2","description":"Sentencer is a string templating engine for madlibs-style sentence generating.","scripts":{"start":"node index.js","test":"gulp test"},"dependencies":{"lodash":"~2.4.1","natural":"~0.1.28","articles":"~0.2.1","randy":"~1.5.1"},"devDependencies":{"gulp":"~3.8.8","gulp-mocha":"~1.1.0"},"main":"index.js","keywords":["sentences","sentence","random","madlibs","metaphorpsum"],"author":{"name":"Kyle Stetz"},"license":"MIT","gitHead":"3475df380e677c5796b63621358b6fc882e7e932","_id":"sentencer@0.1.2","_shasum":"5f78b862b2b697b57e4a5e333d02e0c333a09155","_from":".","_npmVersion":"1.4.24","_npmUser":{"name":"kylestetz","email":"kylestetz@gmail.com"},"maintainers":[{"name":"kylestetz","email":"kylestetz@gmail.com"}],"dist":{"shasum":"5f78b862b2b697b57e4a5e333d02e0c333a09155","tarball":"https://registry.npmjs.org/sentencer/-/sentencer-0.1.2.tgz","integrity":"sha512-p/lyCUD3mbVds8ZxYRpxWC74o+RZCd2FmARDhIpJB1Q3OBPriCmTlHjoZbvbAoNpY8C8apLHL60KcFV/qke7nA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDk1uNokhXnPrsMfcylh/LGjzNefn7R7JvjYcpoSCcBqAIgcx8ldUdCJQutps0JHNK74+8QgyLjV0Wcv+RNdR923cE="}]},"directories":{}},"0.1.3":{"name":"sentencer","version":"0.1.3","description":"Sentencer is a string templating engine for madlibs-style sentence generating.","scripts":{"start":"node index.js","test":"gulp test"},"dependencies":{"lodash":"~2.4.1","natural":"~0.1.28","articles":"~0.2.1","randy":"~1.5.1"},"devDependencies":{"gulp":"~3.8.8","gulp-mocha":"~1.1.0"},"main":"index.js","keywords":["sentences","sentence","random","madlibs","metaphorpsum"],"author":{"name":"Kyle Stetz"},"license":"MIT","gitHead":"3fa280383203bbfc3052303f350d7cc42e998b93","_id":"sentencer@0.1.3","_shasum":"831906cdf61f4f4617614110bccdcecd8035fe97","_from":".","_npmVersion":"1.4.24","_npmUser":{"name":"kylestetz","email":"kylestetz@gmail.com"},"maintainers":[{"name":"kylestetz","email":"kylestetz@gmail.com"}],"dist":{"shasum":"831906cdf61f4f4617614110bccdcecd8035fe97","tarball":"https://registry.npmjs.org/sentencer/-/sentencer-0.1.3.tgz","integrity":"sha512-ka8RBQSmVMiscWSToachqmCsORf9fL14yRRLGnat99ctyfm2Of+I6+V9ZeQIf1+VO76pHdjKZtcNreVP1f2UOg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFJ+vLLuUD2ez4deWSi/MjWesgXppVUjanUzicRhNwQwIgbdr6l8j/TPm1Y6AcFtV9FpQwCx1/uxvTymIRp6Vzjik="}]},"directories":{}},"0.1.4":{"name":"sentencer","version":"0.1.4","description":"Sentencer is a string templating engine for madlibs-style sentence generating.","scripts":{"start":"node index.js","test":"gulp test"},"dependencies":{"lodash":"~2.4.1","natural":"~0.1.28","articles":"~0.2.1","randy":"~1.5.1"},"devDependencies":{"gulp":"~3.8.8","gulp-mocha":"~1.1.0"},"main":"index.js","keywords":["sentences","sentence","random","madlibs","metaphorpsum"],"author":{"name":"Kyle Stetz"},"license":"MIT","gitHead":"57f1fcfc8c482423fbe94bf65f2b6d0188e6421c","_id":"sentencer@0.1.4","_shasum":"49223653ad08eaa3453be9102aa6810a01fe98ef","_from":".","_npmVersion":"1.4.24","_npmUser":{"name":"kylestetz","email":"kylestetz@gmail.com"},"maintainers":[{"name":"kylestetz","email":"kylestetz@gmail.com"}],"dist":{"shasum":"49223653ad08eaa3453be9102aa6810a01fe98ef","tarball":"https://registry.npmjs.org/sentencer/-/sentencer-0.1.4.tgz","integrity":"sha512-WbJaMT3yl+LiYhb4Gv5I7U1R+ckK0a9k7zduiuEIW5F6IIcc3E3m02CO10LVKTAzNRSkWVGeM9L+naob+DKVww==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbI01DGANa4zXopGiTltCpFZby8zTte727YosFmzbI6QIhAIOPMrYsXKhb7dwqfJ+uFhx4ON/SRSS7hxND6KIa+Q8X"}]},"directories":{}},"0.1.5":{"name":"sentencer","version":"0.1.5","description":"Sentencer is a string templating engine for madlibs-style sentence generating.","scripts":{"start":"node index.js","test":"gulp test"},"dependencies":{"lodash":"~2.4.1","natural":"~0.1.28","articles":"~0.2.1","randy":"~1.5.1"},"devDependencies":{"gulp":"~3.8.8","gulp-mocha":"~1.1.0"},"main":"index.js","keywords":["sentences","sentence","random","madlibs","metaphorpsum"],"author":{"name":"Kyle Stetz"},"license":"MIT","gitHead":"3a7eb131ebbf053ed5e2e0065cafb2527b82931f","_id":"sentencer@0.1.5","_shasum":"1c3511581a00b2236127ffb21fde17f4f48659e2","_from":".","_npmVersion":"3.3.9","_nodeVersion":"5.0.0","_npmUser":{"name":"kylestetz","email":"kylestetz@gmail.com"},"dist":{"shasum":"1c3511581a00b2236127ffb21fde17f4f48659e2","tarball":"https://registry.npmjs.org/sentencer/-/sentencer-0.1.5.tgz","integrity":"sha512-cTVaycByVmJTxclJ2SZ6jFKo6No7VQtmnzJOhaRfI8mSg49juaC1K9I0h9+8dJmxirfdVGLbHcxkOPU7xl7NYQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICY4liyAfzN+0xW1AgebK9+jX6PbBQRkH2FWhj47w/vAAiBfDMpf2ybuiWwoVl2rqu/rHKNPyu3q70aq79K+4FpYyg=="}]},"maintainers":[{"name":"kylestetz","email":"kylestetz@gmail.com"}],"directories":{}},"0.2.0":{"name":"sentencer","version":"0.2.0","description":"Sentencer is a string templating engine for madlibs-style sentence generating.","scripts":{"start":"node index.js","test":"gulp test"},"dependencies":{"articles":"~0.2.1","lodash":"^4.17.11","natural":"~0.1.28","randy":"~1.5.1"},"devDependencies":{"gulp":"^4.0.0","gulp-mocha":"^6.0.0"},"main":"index.js","keywords":["sentences","sentence","random","madlibs","metaphorpsum"],"author":{"name":"Kyle Stetz"},"license":"MIT","gitHead":"c0732c992ad06032edab6ed9608b949d7176198f","_id":"sentencer@0.2.0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"kylestetz","email":"kylestetz@gmail.com"},"dist":{"integrity":"sha512-gMNk4d4zX6WHmEF/8O2UlNCoewpNRE4XQUCh/771AqLrCA9qoLP2FRprEARgyJhMk8wkoIzZd1sh7y6HIeY9Rg==","shasum":"94302207dd4e4b35efec26fe5ee8bb127d1c8b3f","tarball":"https://registry.npmjs.org/sentencer/-/sentencer-0.2.0.tgz","fileCount":9,"unpackedSize":94495,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcgoSXCRA9TVsSAnZWagAAYYMQAJYOEKa6wFYQcVTlD0A6\n4ui80k+krFe9secR9JAtLCMfV3f0Bts/6m/okaexjmZBl57c13fxXApBORQu\nOwsFPdK3UAnG8ZKY5iB9DyS64QqRXFWyWcfP9N1oVUCCzseS20+H3eRxOEBd\ntNgYSyTwHYRbfO2r2eA4V3WgLOJemhQb3rI5pq1akyETcWJeP7Jq0ARek/f9\nhUkLn35gVq2Fwj5td0BZH6VlZF6ihK7j+S0tJ6lJpzDe7sLenA+DysFVh1Q+\neLHDtv5LbRr+CrCj/UyjNIANFO00y0nCRwfeIdnuilXB6+lTliP4rffMkqTk\nQQbzx8yoyE5kB3VAYHTN5F+GvzKPRzR7eqlRD8xIl0R7V60Cx3rIqoSxGaE8\n6iY0x9VEYbZzRueuZqz1RSLvipI8GAKGf8fc+OZCiTSjWsqq419GIaL19BEj\n2hrRf2fCcmPmBM02MyD67/RG+j0rHvpIGum21UgYBBnsaVilOVlpQWFnUq2l\nbr4FyQ7zC10/JBX/cORbhBp0RfRBpSuxa82FKngaPLvZk/PzpAIPSwiX1pLg\nvW6YmDghdNQZZual6LAwOUH6CU2JSvIQn74jLB0ToHuZGJozn08OARtgEC1h\nLyL6EFtQ37q0ZBmYtdZrPbGw+4GBOGFmR4oUsc1pEPVj0Y0pXWmYA8C8JQ8E\ns9Ks\r\n=AQXj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUbXpVLt6d0VGyl27YLAWOGPeiT4y/RlJcu8/OIgQLEQIgV0259Sd2HbJbIUywNdGtd8z7KsGuCHchr2k8fkHfxBk="}]},"maintainers":[{"name":"kylestetz","email":"kylestetz@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sentencer_0.2.0_1552057494755_0.9188379514212344"},"_hasShrinkwrap":false},"0.2.1":{"name":"sentencer","version":"0.2.1","description":"Sentencer is a string templating engine for madlibs-style sentence generating.","scripts":{"start":"node index.js","test":"gulp test"},"dependencies":{"articles":"~0.2.1","lodash":"^4.17.11","natural":"~0.1.28","randy":"~1.5.1"},"devDependencies":{"gulp":"^4.0.0","gulp-mocha":"^6.0.0"},"main":"index.js","keywords":["sentences","sentence","random","madlibs","metaphorpsum"],"author":{"name":"Kyle Stetz"},"license":"MIT","gitHead":"2056ed2c66b7ad83a2337e8194dd1c25997a5346","_id":"sentencer@0.2.1","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"kylestetz","email":"kylestetz@gmail.com"},"dist":{"integrity":"sha512-hDLHIc7DTdZASPJhL2IZChmUq9tTUsOaAlK2kNPYI9KSdrPeqNZfjJfTCEoqcR/IlLlIfngi7Wkx/KLPqqNtyQ==","shasum":"88a1f4767c14bb8cd148b07822e13b8b55897956","tarball":"https://registry.npmjs.org/sentencer/-/sentencer-0.2.1.tgz","fileCount":9,"unpackedSize":95997,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJefKpECRA9TVsSAnZWagAAnmAP/3xYhRtGqy0bCJWWPPX/\nYJIaRkpzG+oU4Vyze1nzWchX32q9I1KIjZh8v3Ev5MmkBzrB9H6DFK7ugor/\ngGX1q7c8tN1hgHuze2gqEo3y8a8rIbQCIUqiaBH0lDHx6UMiaQjm4V/zsAh1\n+dP+mdvtk2PoDtOAUSd/xFMKGvLdJTyJ1q90EVNthT8CxiEx/40OFnA0kLGh\nYia895sA3pRukkfwAQRRCImB7hG/7/UB+A8p2SkEfqU7L1z8AoTCPosQDtiU\nHBUhgUqSi9PzOF2MqD64bHpHaVm6zkLymNs5tnD2HmMirbNSKFQDWziw6fD0\nRT8sFXphEsLs0aVuMIpIgVgyzEChIMHCqfCp6f0rSp7LB9H1kXpVIw6ysS90\nbTK3g/1tAZQQUBiFW9u3jIAp2jHsjz6trneIGe5eYgV6rUu3CmWPQwvXtryh\nclWCxj3CT4o94ipKtvM8n3+mxLjYZhDTjDB4f3Fu5txU936utxV52blCkYYw\n0Pk7ZvuMo4UQh9lPKEzrNCKmS6LAUP8EbIXIFfIngBSNYumKgeptejY/vMRf\nhZB8schjDwfQJSrEh3ZlhkneDaihfTqUoay54GBH0gtQJkgxCz268CC5OCiY\nwgelq6u/AksNr8kcj2n6PdH7ouGjadk2/Xow7dQHzgYJtuw5gd9IXHOJd7/9\nVjy3\r\n=RGhf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBCPCiYMd1xHpCLkcKSaT5dIXB4SRZazWxUxURfakhtpAiEAkiQ86U6MpaZIk62vjoaM5Cztle6i5F/XVUAXcaHl+sI="}]},"maintainers":[{"name":"kylestetz","email":"kylestetz@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sentencer_0.2.1_1585228356031_0.7211677381810597"},"_hasShrinkwrap":false}},"readme":"# Sentencer\n\n[![Build Status](https://travis-ci.org/kylestetz/Sentencer.svg?branch=master)](https://travis-ci.org/kylestetz/Sentencer)\n\n`sentencer` is a node.js module for madlibs-style sentence templating. It is a simple templating engine that accepts strings with actions embedded in them:\n\n```javascript\n\"This is {{ an_adjective }} sentence.\"\n```\n\nWhere each action returns a random string selected from a list:\n\n```javascript\n\"This is a bankrupt sentence.\"\n```\n\nThink of it as madlibs for Javascript. Want to roll your own lorem ipsum generator? `Sentencer` allows you to write the structure of your sentences and plug in any kind of vocabulary you choose.\n\n`Sentencer` was written for and powers [Metaphorpsum](http://metaphorpsum.com). The noun and adjective lists come from a relatively small curated selection of Ashley Bovan's excellent [Word Lists for Writers](http://www.ashley-bovan.co.uk/words/partsofspeech.html).\n\n### How\n\n`npm install sentencer --save`\n\n```javascript\nvar Sentencer = require('sentencer');\n\nSentencer.make(\"This sentence has {{ a_noun }} and {{ an_adjective }} {{ noun }} in it.\");\n// returns something like \"This sentence has a bat and a finless cinema in it.\"\n```\n\nHere are all of the options, described in detail below.\n\n```javascript\nvar Sentencer = require('sentencer');\n\nSentencer.configure({\n  // the list of nouns to use. Sentencer provides its own if you don't have one!\n  nounList: [],\n\n  // the list of adjectives to use. Again, Sentencer comes with one!\n  adjectiveList: [],\n\n  // additional actions for the template engine to use.\n  // you can also redefine the preset actions here if you need to.\n  // See the \"Add your own actions\" section below.\n  actions: {\n    my_action: function(){\n      return \"something\";\n    }\n  }\n});\n```\n\n### Actions\n\n`Sentencer` works by recognizing \"actions\" within `{{ double_brackets }}`. It replaces these actions with strings. The default actions are `{{ noun }}`, `{{ a_noun }}`, `{{ nouns }}`, `{{ adjective }}`, and `{{ an_adjective }}`, but you can extend `Sentencer` to include any kind of actions you need!\n\nThe default actions will continue to work if you pass in new a `nounList` and/or `adjectiveList` using `Sentencer.configure`.\n\n`Sentencer`'s actions are written semantically so that your sentence template still reads as a sentence. While this was simply a design decision, it does make templates easier to read and you are encouraged to follow this format if you create custom actions.\n\n#### `\"{{ noun }}\"`\n\nReturns a random noun from the noun list.\n\n```javascript\nvar noun = Sentencer.make(\"{{ noun }}\")\n// \"actor\", \"knight\", \"orchid\", \"pizza\", etc.\n```\n\n#### `\"{{ a_noun }}\"`\n\nReturns a random noun from the noun list with \"a\" or \"an\" in front of it.\n\n```javascript\nvar nounWithArticle = Sentencer.make(\"{{ a_noun }}\")\n// \"an actor\", \"a knight\", \"an orchid\", \"a pizza\", etc.\n```\n\n#### `\"{{ nouns }}\"`\n\nReturns the pluralized form of a random noun from the noun list. It's not 100% perfect, but it's probably 97% perfect.\n\n```javascript\nvar pluralNoun = Sentencer.make(\"{{ nouns }}\")\n// \"actors\", \"knights\", \"orchids\", \"pizzas\", etc.\n```\n\n#### `\"{{ adjective }}\"`\n\nReturns a random adjective from the adjective list.\n\n```javascript\nvar adjective = Sentencer.make(\"{{ adjective }}\")\n// \"blending\", \"earthy\", \"rugged\", \"untamed\", etc.\n```\n\n#### `\"{{ an_adjective }}\"`\n\nReturns a random adjective from the adjective list with \"a\" or \"an\" in front of it.\n\n```javascript\nvar adjective = Sentencer.make(\"{{ an_adjective }}\")\n// \"a blending\", \"an earthy\", \"a rugged\", \"an untamed\", etc.\n```\n\n### Add your own actions\n\nWhen configuring `Sentencer` you can provide your own \"actions\", which are just functions that return something. The name of the function that you pass into `actions` is how you will reference it within a sentence template.\n\nHere's an example of an action that returns a random number from 1 to 10.\n\n```javascript\nvar Sentencer = require('sentencer');\n\nSentencer.configure({\n  actions: {\n    number: function() {\n      return Math.floor( Math.random() * 10 ) + 1;\n    }\n  }\n});\n\nconsole.log( Sentencer.make(\"I can count to {{ number }}.\")\n// \"I can count to 5.\"\n```\n\n#### Actions can take arguments\n\nYou can pass arguments into your actions. We can use this to make a smarter version of the random number generator above...\n\n```javascript\nvar Sentencer = require('sentencer');\n\nSentencer.configure({\n  actions: {\n    number: function(min, max) {\n      return Math.floor( Math.random() * (max - min) ) + min;\n    }\n  }\n});\n\nconsole.log( Sentencer.make(\"I can count to {{ number(8, 10) }}.\")\n// \"I can count to 8.\"\n```\n\nA technical note: if `Sentencer` finds that you have provided arguments to your action it will use `eval` in order to call it. It will `try`/`catch` this in case it fails, but one definite limitation is that your action can't contain characters that would force you to use `object[\"property\"]` notation. For example, `\"{{ my-custom-action(3) }}\"` would fail, whereas `\"{{ my_custom_action(3) }}\"` would succeed.\n\n### Where are the verbs?\n\nVerb pluralization, singularization, and tense modification are difficult computer science problems. `Sentencer` doesn't aim to solve those problems, however _present tense_ verb pluralization/singularization is an experimental feature of [`natural`](https://github.com/NaturalNode/natural) and could be integrated if necessary.\n\n-----------\n\n`Sentencer` was created and is maintained by [Kyle Stetz](https://github.com/kylestetz). The original prototype came out of [Metaphorpsum](https://github.com/kylestetz/metaphorpsum) but has been rewritten from the ground up.","maintainers":[{"name":"kylestetz","email":"kylestetz@gmail.com"}],"time":{"modified":"2023-07-09T22:07:40.841Z","created":"2014-10-11T18:42:13.328Z","0.1.1":"2014-10-11T18:42:13.328Z","0.1.2":"2015-02-08T03:56:41.340Z","0.1.3":"2015-02-08T04:00:51.863Z","0.1.4":"2015-02-08T05:10:41.299Z","0.1.5":"2015-12-22T16:33:19.963Z","0.1.6":"2019-03-08T15:03:07.712Z","0.2.0":"2019-03-08T15:04:54.932Z","0.2.1":"2020-03-26T13:12:36.160Z"},"keywords":["sentences","sentence","random","madlibs","metaphorpsum"],"author":{"name":"Kyle Stetz"},"license":"MIT","readmeFilename":"README.md","users":{"chocolateboy":true,"sky3r":true,"martinspinks":true,"flumpus-dev":true}}