{"_id":"pinecone","_rev":"4-2e90893dcae3859ade35a1e329e847bb","name":"pinecone","description":"JavaScript->Lua converter","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"pinecone","version":"0.1.0","description":"JavaScript->Lua converter","main":"lib/index.js","bin":{"pinecone":"bin/pinecone"},"preferGlobal":true,"dependencies":{"acorn":"~0.5.0","debug":"^0.8.1","fast.js":"0.0.3","minimist":"^1.1.0"},"repository":{"type":"git","url":"https://github.com/zekesonxx/pinecone.git"},"keywords":["javascript","lua","convert","ast"],"author":{"name":"Zeke Sonxx","email":"zeke@zekesonxx.com"},"license":"MIT","bugs":{"url":"https://github.com/zekesonxx/pinecone/issues"},"homepage":"https://github.com/zekesonxx/pinecone","_id":"pinecone@0.1.0","dist":{"shasum":"bfebd6babc7245e5c42d9c81286dd507f403e3d9","tarball":"https://registry.npmjs.org/pinecone/-/pinecone-0.1.0.tgz","integrity":"sha512-iKu0Vs4ijfueG9fRoOfJ6Ko0Yb/y/XK2kmNXz9WgG8LuDwneXWcmPQqhm7nUvAxFroQQdGSmM2zM33d4l/4UfQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1doi2IPF/6a9yGqpJFMYnfS2VcpFHCOP9vNqIIXRguwIhAMliR5Vv30HFZfCAypl9RhFf1UJWAorSarbdvQclWbfl"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"zekesonxx","email":"zeke@zekesonxx.com"},"maintainers":[{"name":"zekesonxx","email":"zeke@zekesonxx.com"}]}},"readme":"# pinecone: A JavaScript->Lua converter\r\n\r\nSo, I wrote a JS->Lua converter. Instead of being based on regex or some other dumb idea, it's based on [acorn][acorn], an awesome and superfast JavaScript Annotated Source Tree (AST) generator. Pinecone takes that and turns it into mostly-valid Lua.\r\n\r\nIt was written by running `$ acorn try.js > try.json` and looking at the JSON over and over, so don't expect very good standard conformity.\r\n\r\n## What works\r\n* Variables `var a = 1`\r\n* Multiple Variables `var a = 1, b = 2`\r\n* Changing variables `a = 2`\r\n* Functions `function a() { return 1 }`\r\n* Functions declared as variables `var a = function () { return 1 }`\r\n* If/ifelse/else\r\n* `typeof thing` (turned into `type(thing)`)\r\n* Graceful failing\r\n* While loops\r\n* Do While loops (converted to `repeat` loops)\r\n\r\n## What doesn't\r\n* Comments\r\n* For loops\r\n* Everything else\r\n\r\n\r\n## Usage\r\nDon't.\r\n\r\n## Example\r\n````js\r\nvar k = 'blue', b, f = 12;\r\n\r\nvar p = 4;\r\n\r\nif (typeof k == 'string') {\r\n  print('String!');\r\n}\r\n\r\nfunction bacon() {\r\n  return 'bacon';\r\n}\r\n\r\nvar f = function () {\r\n\r\n};\r\n````\r\nturns into\r\n````lua\r\n--# Converted using pinecone v0.1.0\r\n\r\nlocal k, b, f = \"blue\", nil, 12\r\nlocal p = 4\r\nif type(k) == \"string\" then\r\n  print(\"String!\")\r\n  \r\nend\r\nfunction bacon()\r\n  return \"bacon\"\r\n  \r\nend\r\nlocal f = function() end\r\n````\r\n\r\n## Contributing\r\nNot to be rude, but good luck. The codebase is in sore shape.  \r\nI tried to comment as much as possible, but it's not that great, and badly organized.\r\nBut if you do decide to contribute, make sure you code passes a jshint lint.\r\nOutputted Lua code made from JS code that passes jshint (that pinecone fully supports) should pass luac.\r\n\r\n## License\r\nMIT licensed. Refer to `LICENSE`.\r\n\r\n\r\n  [acorn]: https://github.com/marijnh/acorn","maintainers":[{"name":"zekesonxx","email":"zeke@zekesonxx.com"}],"time":{"modified":"2022-06-23T23:52:58.823Z","created":"2014-08-22T22:49:06.185Z","0.1.0":"2014-08-22T22:49:06.185Z"},"homepage":"https://github.com/zekesonxx/pinecone","keywords":["javascript","lua","convert","ast"],"repository":{"type":"git","url":"https://github.com/zekesonxx/pinecone.git"},"author":{"name":"Zeke Sonxx","email":"zeke@zekesonxx.com"},"bugs":{"url":"https://github.com/zekesonxx/pinecone/issues"},"license":"MIT","readmeFilename":"README.md"}