{"_id":"msw-api","_rev":"35-11e68412ac02abe8e5c7a6f4a77ad229","name":"msw-api","description":"Node wrapper for Magicseaweed API","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.2":{"name":"msw-api","version":"0.0.2","description":"Node wrapper for Magicseaweed API","main":"lib/main.js","scripts":{"test":"mocha"},"keywords":["magicseaweed","msw","msw api"],"dependencies":{"moment":"=2.4.0","underscore":"=1.5.2","q":"=0.9.7"},"devDependencies":{"mocha":"=1.13.0","chai":"=1.8.1","nock":"=0.25.0","chai-as-promised":"=4.1.0"},"engines":{"node":">0.6.0"},"repository":{"type":"git","url":"https://github.com/justinjmoses/msw-api.git"},"bugs":{"url":"https://github.com/justinjmoses/msw-api/issues"},"author":{"name":"justin j. moses"},"license":"BSD-2-Clause","_id":"msw-api@0.0.2","dist":{"shasum":"d9c081f61b031ddd93199d737eb7a36c6d7b3c51","tarball":"https://registry.npmjs.org/msw-api/-/msw-api-0.0.2.tgz","integrity":"sha512-UGbWudDxdb3WUeQdfMeSd2TxDm8ODs+KxWpeI4sVuh9LZN5Hqwz5R5PU5OJJCUtCop3gS9MvvbgyQxALBtMZAg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC5w3j8FgHyzOrIxjjY8ywqZYKJEncfkTXcx8UaT05c2gIhAK5jg9L2BPVKqa3zScRoCEzhMzXVVlspW5d35mLJecXn"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"justinjmoses","email":"justinjmoses@gmail.com"},"maintainers":[{"name":"justinjmoses","email":"justinjmoses@gmail.com"}],"directories":{}},"0.0.3":{"name":"msw-api","version":"0.0.3","description":"Node wrapper for Magicseaweed API","main":"lib/main.js","scripts":{"test":"mocha"},"keywords":["magicseaweed","msw","msw api"],"dependencies":{"moment":"=2.4.0","underscore":"=1.5.2","q":"=0.9.7"},"devDependencies":{"mocha":"=1.13.0","chai":"=1.8.1","nock":"=0.25.0","chai-as-promised":"=4.1.0"},"engines":{"node":">0.6.0"},"repository":{"type":"git","url":"https://github.com/justinjmoses/msw-api.git"},"bugs":{"url":"https://github.com/justinjmoses/msw-api/issues"},"author":{"name":"justin j. moses"},"license":"BSD-2-Clause","_id":"msw-api@0.0.3","dist":{"shasum":"17cd4bd1cf28532a3312f3f3a0114eb9e74884b8","tarball":"https://registry.npmjs.org/msw-api/-/msw-api-0.0.3.tgz","integrity":"sha512-sMlcDU+IrYwYLd9JJamBzZrvqBZdrE7sLFzc7BP8aPxT9WJsEeXCAXoq7szOJuiMxnYIu+oNjasCL0dchUCuvg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFM4Vnv07MioBmGx400tllSfdFEDmFjLd1D35ypWBAyUAiAlJC1BsAuB/CO8WTTohWqyg0TutoPuCOC34qOvTP9vcA=="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"justinjmoses","email":"justinjmoses@gmail.com"},"maintainers":[{"name":"justinjmoses","email":"justinjmoses@gmail.com"}],"directories":{}},"0.0.4":{"name":"msw-api","version":"0.0.4","description":"Node wrapper for Magicseaweed API","main":"lib/main.js","scripts":{"test":"mocha"},"keywords":["magicseaweed","msw","msw api"],"dependencies":{"moment":"=2.4.0","underscore":"=1.5.2","q":"=0.9.7"},"devDependencies":{"mocha":"=1.13.0","chai":"=1.8.1","nock":"=0.25.0","chai-as-promised":"=4.1.0"},"engines":{"node":">0.6.0"},"repository":{"type":"git","url":"https://github.com/justinjmoses/msw-api.git"},"bugs":{"url":"https://github.com/justinjmoses/msw-api/issues"},"author":{"name":"justin j. moses"},"license":"BSD-2-Clause","_id":"msw-api@0.0.4","dist":{"shasum":"dd9aea0d98ac7d6ce7678a4e9fa84185a6177ccb","tarball":"https://registry.npmjs.org/msw-api/-/msw-api-0.0.4.tgz","integrity":"sha512-6mp6OoXaYjNmljwKTBHnC3hrGiixPhpNCHyHZSd3DVf5FxrfKC5mPtKlAHH185Eyz60hdWATTH6PPQA+QcJtAA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCdiMMOpHpadm15PLaeDQc9kmgR4A++4CXhwaDjRM7xjwIhAL42mzNFJUejvYYg41Gz9kiYxhOZ7+YgZK4obsMZe81A"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"justinjmoses","email":"justinjmoses@gmail.com"},"maintainers":[{"name":"justinjmoses","email":"justinjmoses@gmail.com"}],"directories":{}},"0.0.5":{"name":"msw-api","version":"0.0.5","description":"Node wrapper for Magicseaweed API","main":"lib/main.js","scripts":{"test":"mocha"},"keywords":["magicseaweed","msw","msw api"],"dependencies":{"moment":"=2.4.0","underscore":"=1.5.2","q":"=0.9.7"},"devDependencies":{"mocha":"=1.13.0","chai":"=1.8.1","nock":"=0.25.0","chai-as-promised":"=4.1.0"},"engines":{"node":">0.6.0"},"repository":{"type":"git","url":"https://github.com/justinjmoses/msw-api.git"},"bugs":{"url":"https://github.com/justinjmoses/msw-api/issues"},"author":{"name":"justin j. moses"},"license":"BSD-2-Clause","_id":"msw-api@0.0.5","dist":{"shasum":"f1685beb84b0e354205577d5516e447f8335fea3","tarball":"https://registry.npmjs.org/msw-api/-/msw-api-0.0.5.tgz","integrity":"sha512-toWzatRS2xLho2gyzc0VQtB/8tRH2oqWLHmGC49x4C0/86Vs4eKM0I7ojFsf/IGHeG6OrNRPp4SCqbVdRd1Bgw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD27yvQZdoQFCtZrV4oRwHCl5JeUQAs2ZuRWh+GNCFJPwIgBwYRBf1xlKjsTMJFxSY+Femtj+eKtsnJ6sFH9tRpqQc="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"justinjmoses","email":"justinjmoses@gmail.com"},"maintainers":[{"name":"justinjmoses","email":"justinjmoses@gmail.com"}],"directories":{}},"0.0.6":{"name":"msw-api","version":"0.0.6","description":"Node wrapper for Magicseaweed API","main":"lib/main.js","scripts":{"test":"mocha"},"keywords":["magicseaweed","msw","msw api"],"dependencies":{"moment":"=2.4.0","underscore":"=1.5.2","q":"=0.9.7"},"devDependencies":{"mocha":"=1.13.0","chai":"=1.8.1","nock":"=0.25.0","chai-as-promised":"=4.1.0"},"engines":{"node":">0.6.0"},"repository":{"type":"git","url":"https://github.com/justinjmoses/msw-api.git"},"bugs":{"url":"https://github.com/justinjmoses/msw-api/issues"},"author":{"name":"justin j. moses"},"license":"BSD-2-Clause","_id":"msw-api@0.0.6","dist":{"shasum":"82e06d517db1ce24085da0008937359eace3da19","tarball":"https://registry.npmjs.org/msw-api/-/msw-api-0.0.6.tgz","integrity":"sha512-Onv8JQzJMdwF0G2GlZyRpsNguHL3sxGTAWwgNhxs37QkPno3O1Q+u8+Y9ZKhqt5hRwSThEVPF4umqBWIQgXnfA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDKhm6IACvQEaBuYizQiJvgCCEPUyurQR8B4CpDhrugmAiEAvVDMTNrYBnQzdOx4HnE1f+PEIlSW9c4RHwaVzVLsBXQ="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"justinjmoses","email":"justinjmoses@gmail.com"},"maintainers":[{"name":"justinjmoses","email":"justinjmoses@gmail.com"}],"directories":{}},"0.0.7":{"name":"msw-api","version":"0.0.7","description":"Node wrapper for Magicseaweed API","main":"lib/main.js","scripts":{"test":"mocha"},"keywords":["magicseaweed","msw","msw api"],"dependencies":{"moment":"=2.4.0","underscore":"=1.5.2","q":"=0.9.7"},"devDependencies":{"mocha":"=1.13.0","chai":"=1.8.1","nock":"=0.25.0","chai-as-promised":"=4.1.0"},"engines":{"node":">0.6.0"},"repository":{"type":"git","url":"https://github.com/justinjmoses/msw-api.git"},"bugs":{"url":"https://github.com/justinjmoses/msw-api/issues"},"author":{"name":"justin j. moses"},"license":"BSD-2-Clause","_id":"msw-api@0.0.7","dist":{"shasum":"9fc9bfdfe28c5528cf97a11005573540237fda23","tarball":"https://registry.npmjs.org/msw-api/-/msw-api-0.0.7.tgz","integrity":"sha512-UykfszgwYkDMPG0nusw8Q1SqpZCZZEwVmhyfBZ6Iq7BDT7Vq14wpU1bFFiuyX+o1Q7kyhqZpYmDBW/X8HtDZCQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGaTXk4JSydpLMJ8JujYZlrNIvPnj7Cz2ESRjBJxl6LtAiEAhBuGCeLBk3cgXmBuY5U7lK3P9q2NLqjoB2OpFT/dFWY="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"justinjmoses","email":"justinjmoses@gmail.com"},"maintainers":[{"name":"justinjmoses","email":"justinjmoses@gmail.com"}],"directories":{}},"0.0.8":{"name":"msw-api","version":"0.0.8","description":"Node wrapper for Magicseaweed API","main":"lib/main.js","scripts":{"test":"mocha --recursive"},"keywords":["magicseaweed","msw","msw api"],"dependencies":{"moment":"=2.4.0","underscore":"=1.5.2","q":"=0.9.7"},"devDependencies":{"mocha":"=1.13.0","chai":"=1.8.1","nock":"=0.25.0","chai-as-promised":"=4.1.0"},"engines":{"node":">0.6.0"},"repository":{"type":"git","url":"https://github.com/justinjmoses/msw-api.git"},"bugs":{"url":"https://github.com/justinjmoses/msw-api/issues"},"author":{"name":"justin j. moses"},"license":"BSD-2-Clause","_id":"msw-api@0.0.8","dist":{"shasum":"0cf4e53485dd7a33aed5db071d4624ea266e5834","tarball":"https://registry.npmjs.org/msw-api/-/msw-api-0.0.8.tgz","integrity":"sha512-FTExbB1rk9u7r6bD2MDuu75p+hjCGeHu+wbwWuk9E3WCnQR3Zf+ovv43ecHsdM9DvvgedGbLCCWI6MXBOCYgcw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE9qbX2GVVaOEQOLSf0dIkSnrAkdnI3QiFo4KlufuxJoAiEA9jFGWGOholhb4zEmNCFl2g2XZk0IC7jQPTOY43yGbyQ="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"justinjmoses","email":"justinjmoses@gmail.com"},"maintainers":[{"name":"justinjmoses","email":"justinjmoses@gmail.com"}],"directories":{}},"0.0.9":{"name":"msw-api","version":"0.0.9","description":"Node wrapper for Magicseaweed API","main":"lib/main.js","scripts":{"test":"mocha --recursive"},"keywords":["magicseaweed","msw","msw api"],"dependencies":{"moment":"=2.4.0","underscore":"=1.5.2","q":"=0.9.7"},"devDependencies":{"mocha":"=1.13.0","chai":"=1.8.1","nock":"=0.25.0","chai-as-promised":"=4.1.0"},"engines":{"node":">0.6.0"},"repository":{"type":"git","url":"https://github.com/justinjmoses/msw-api.git"},"bugs":{"url":"https://github.com/justinjmoses/msw-api/issues"},"author":{"name":"justin j. moses"},"license":"BSD-2-Clause","_id":"msw-api@0.0.9","dist":{"shasum":"fdc3a145c4f6cc421cee974a9dd82b06619064d3","tarball":"https://registry.npmjs.org/msw-api/-/msw-api-0.0.9.tgz","integrity":"sha512-zoUW2dAYjcR6Nlb/3+Pmseb32YoilbqXkpY3RiNi0jWgPdpl7YZk4qCoqBmpePBpxoLlCWq9+od1YVZJ71fsOA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDESE6qRPbXy9TLUkvlMDeQOjtQoH16CV/ly0XpQOr7sgIgCXOzEvX2SzmXOZ04IYFwyYgdXhG4uueSavoiO0dSglo="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"justinjmoses","email":"justinjmoses@gmail.com"},"maintainers":[{"name":"justinjmoses","email":"justinjmoses@gmail.com"}],"directories":{}},"0.0.10":{"name":"msw-api","version":"0.0.10","description":"Node wrapper for Magicseaweed API","main":"lib/main.js","scripts":{"test":"mocha --recursive"},"keywords":["magicseaweed","msw","msw api"],"dependencies":{"moment":"=2.4.0","underscore":"=1.5.2","q":"=0.9.7"},"devDependencies":{"mocha":"=1.13.0","chai":"=1.8.1","nock":"=0.25.0","chai-as-promised":"=4.1.0"},"engines":{"node":">0.6.0"},"repository":{"type":"git","url":"https://github.com/justinjmoses/msw-api.git"},"bugs":{"url":"https://github.com/justinjmoses/msw-api/issues"},"author":{"name":"justin j. moses"},"license":"BSD-2-Clause","_id":"msw-api@0.0.10","dist":{"shasum":"1123b70a1c763730b13ac0d57315a373c803d1d9","tarball":"https://registry.npmjs.org/msw-api/-/msw-api-0.0.10.tgz","integrity":"sha512-g1ty6dKmYI8rRLI1AN4nCwlxtwnQjIQgYTt0r8ZEaB29vKtM6WrlkK5MiJx9/jkkVs9iTTVjTgGWnmAanl7l7w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqT0AZ97fDWez26WgEDxXcNz/LGU84QlgWyhpK6mfQ2wIhAN28khCnfgtDfuvrs5aavMjMm3M6WATS5z7DUZZvf9a0"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"justinjmoses","email":"justinjmoses@gmail.com"},"maintainers":[{"name":"justinjmoses","email":"justinjmoses@gmail.com"}],"directories":{}},"0.0.11":{"name":"msw-api","version":"0.0.11","description":"Node wrapper for Magicseaweed API","main":"lib/main.js","scripts":{"test":"mocha --recursive"},"keywords":["magicseaweed","msw","msw api"],"dependencies":{"moment":"=2.4.0","underscore":"=1.5.2","q":"=0.9.7"},"devDependencies":{"mocha":"=1.13.0","chai":"=1.8.1","nock":"=0.25.0","chai-as-promised":"=4.1.0"},"engines":{"node":">0.6.0"},"repository":{"type":"git","url":"https://github.com/justinjmoses/msw-api.git"},"bugs":{"url":"https://github.com/justinjmoses/msw-api/issues"},"author":{"name":"justin j. moses"},"license":"BSD-2-Clause","_id":"msw-api@0.0.11","dist":{"shasum":"95196b3fdf005d92bd940b3f0fb7fc68c8c7aeac","tarball":"https://registry.npmjs.org/msw-api/-/msw-api-0.0.11.tgz","integrity":"sha512-xyC0UFV6D/Z4Rk/leUVXigTRvIGq7ZobMEdi8fwjiqPQHG7bsr98wHyjh1HSSljLYFz3uTT22jcVIfg5Fywzqg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdFWbZ/dwajTa5ebmhQhpSptmWsR6IhjSF77aM9/S0cAIgSR7IfvOtL/U+qQy4WHxp41TTQwwfMIewkmYtVWF7vt4="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"justinjmoses","email":"justinjmoses@gmail.com"},"maintainers":[{"name":"justinjmoses","email":"justinjmoses@gmail.com"}],"directories":{}},"0.0.12":{"name":"msw-api","version":"0.0.12","description":"Node wrapper for Magicseaweed API","main":"lib/main.js","scripts":{"test":"mocha --recursive"},"keywords":["magicseaweed","msw","msw api"],"dependencies":{"moment":"=2.4.0","underscore":"=1.5.2","q":"=0.9.7","nock":"=0.25.0"},"devDependencies":{"mocha":"=1.13.0","chai":"=1.8.1","chai-as-promised":"=4.1.0"},"engines":{"node":">0.6.0"},"repository":{"type":"git","url":"https://github.com/justinjmoses/msw-api.git"},"bugs":{"url":"https://github.com/justinjmoses/msw-api/issues"},"author":{"name":"justin j. moses"},"license":"BSD-2-Clause","_id":"msw-api@0.0.12","dist":{"shasum":"37fa5da0b997f5019d034730e12c63d5ce5ace4a","tarball":"https://registry.npmjs.org/msw-api/-/msw-api-0.0.12.tgz","integrity":"sha512-vCvdSGMXv6Gn//awZo86xeZ/M9/pR4jxtpE8LAlm7BwNdhjQT/ZfkCkPOteBy3TuDrThGj3AXCIpIJyt4QwzTA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQtidCpsWLs6W/5GUa83wCbOwXIVbflgV9OUc0rAJgfQIhAJIMnvBT1zWQOmwqo5hkwVJ/wHCjI7SZdEZSFKDJR/HW"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"justinjmoses","email":"justinjmoses@gmail.com"},"maintainers":[{"name":"justinjmoses","email":"justinjmoses@gmail.com"}]},"0.1.0":{"name":"msw-api","version":"0.1.0","description":"Node wrapper for Magicseaweed API","main":"lib/main.js","scripts":{"test":"mocha --recursive"},"keywords":["magicseaweed","msw","msw api"],"dependencies":{"moment":"=2.4.0","underscore":"=1.5.2","q":"=0.9.7","nock":"=0.25.0"},"devDependencies":{"mocha":"=1.13.0","chai":"=1.8.1","chai-as-promised":"=4.1.0"},"engines":{"node":">0.6.0"},"repository":{"type":"git","url":"git+https://github.com/justinjmoses/msw-api.git"},"bugs":{"url":"https://github.com/justinjmoses/msw-api/issues"},"author":{"name":"justin j. moses"},"license":"BSD-2-Clause","gitHead":"9af0835b373db1741552aa5ad44529d830221962","homepage":"https://github.com/justinjmoses/msw-api#readme","_id":"msw-api@0.1.0","_shasum":"43b614928f78135f1d9c704c9843be6a976bcf8f","_from":".","_npmVersion":"2.14.8","_nodeVersion":"0.12.7","_npmUser":{"name":"justinjmoses","email":"justinjmoses@gmail.com"},"dist":{"shasum":"43b614928f78135f1d9c704c9843be6a976bcf8f","tarball":"https://registry.npmjs.org/msw-api/-/msw-api-0.1.0.tgz","integrity":"sha512-wKYzPC4VwgPFY1ltcZ/S+84cIXEUlCqTbSUPDw3PuLi2j84TTTurA2auzfF69IknijmKey1EpMw16up/3tUTvw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9DtDQD4ynuCxMywc6QjzlswGX16mWCTz78z7rQLPJRgIgJTM7mflL/spvdRtCojlS8Co2aK2xeQ23X1hswNNyzVI="}]},"maintainers":[{"name":"justinjmoses","email":"justinjmoses@gmail.com"}]}},"readme":"Magicseaweed API\n=============\n\n[![Build Status](https://travis-ci.org/justinjmoses/msw-api.png)](https://travis-ci.org/justinjmoses/msw-api)\n\nNode wrapper for Magicseaweed (MSW) developer API. \n\n[MSW API Docs](http://magicseaweed.com/developer/forecast-api)\n\n##Quickstart\n\n```javascript\n//Add the API to your module\nvar msw = require('msw-api');\n\n//Configure the instance to use your API key, optionally override the units (default is 'US')\nmsw.set({ apiKey: 'YOUR API KEY GOES HERE' , units: 'us' });\n\n//Get a promise for the swell forecast for spot at id 169 (Mundaka)\nmsw.forecast(169).then(function (forecast) {\n\n    //Return all forecasts at least 5 solid stars and at least 6 \n    //(feet in this case as the request was using 'us' units) high, and at least 16s in primary swell period  \n    forecast.where\n        ({\n            minSolidStars: 5,\n            minBreakingHeight: 6,\n            minPeriod: 16\n        });\n\n}, function (err) {\n    console.log('ERR: encountered error getting MSW data: ' + err);\n});\n```\n\n##API\n\n###msw.set(): static configuration\n\n```javascript\n//signature\nmsw.set(Object parameters) : msw;\n```\n\n```javascript\n//apiKey: your MSW API key is required for any transactions. \nmsw.set({ apiKey: 'YOUR API KEY GOES HERE' });\n\n//units: optionally set the units you want (option of US, EU &amp; UK). Default of 'US'. Case insensitive.\nmsw.set({ units: 'EU' });\n\n//Obviously you can do both in one call\nmsw.set({ apiKey: 'API KEY', units: 'UK' });\n```\n\n>Go to [MSW](http://magicseaweed.com/developer/sign-up) to get an API key.\n\n###msw.forecast(): get swell forecast\n\n```javascript\n//signature\nmsw.forecast(int spotId | Object options) : Promises/A+ for Forecast\n```\n\n```javascript\n//Option 1: using spotId integer (uses pre-set `units` via `set()` or default value of 'US')\nmsw.forecast(123);\n\n//Option 2: using options object \n//  spotId required\n//  units optional: overrides whatever pre-defined units are for this call only\nmsw.forecast({ spotId: 123, units: 'eu' });\n```\n\nThrows `Error` when: \n\n* no parameter is given\n* `apiKey` not `set()`\n\nReturns:\n\n* promise with `Forecast` data. (Specifically returns a [Q](https://github.com/kriskowal/q) promise). \n\n```javascript\nmsw.forecast(358).then(function (forecast) {\n    console.log('Successfully retrieved data for Manasquan, NJ');\n}, function (err) {\n    console.log('ERR: encountered error getting MSW data: ' + err);\n});\n```\n\n>Note: Errors in retrieving data from Magicseaweed, invalid API KEY and invalid spot ID handled by a rejected promise. Handle these errors in second argument to `then()` as per the Promises/A+ spec. \n\n###msw.mockCallsUsing(): enable mock responses (for testing)\n\n```javascript\n//signature\nvar mocks = msw.mockCallsUsing('YOUR API KEY');\n```\n\n##mocks\n\n###mocks.mockSpot(): Mocks a single spot call\n\n```javascript\n//signature\nmocks.mockSpot(int spotId, String units, int httpResponse);\n```\n\n>If the `spotId` does not exist in the samples, or the httpResponse is not `200`, the mocked HTTP response will return `undefined`.\n\n###mocks.data: Sample data for a spot (if any)\n\n```javascript\nvar mockSpot169 = mocks.data['169'];\nvar forecast = new Forecast(mockSpot169);\n```\n\n##Forecast \n\nThis is the instance yielded by a fulfilled `msw.forecast()` promise. \n\n###forecast.filter(): Creates new Forecast by filtering entries\n```javascript\n//signature\nforecast.filter(Function callback) : Forecast\n```\n\nCreates a new `Forecast` via a boolean callback function. Note that the underlying `ForecastEntry` instances are shared by reference and thus are mutable. \n\nCallback of the standard form `function (item, index, array)`.\n\n```javascript\nmsw.forecast(358).then(function (forecast) {\n    var newForecast = forecast.filter(function (entry, i) {\n        return entry.swell.components.secondary.height < 4;\n    });\n}, ...);\n```\n\n###forecast.toArray(): Swell data as Array\n```javascript\n//signature\nforecast.toArray() : Array\n```\n\nReturns an `Array` of `ForecastEntry`.\n\n```javascript   \nmsw.forecast(358).then(function (forecast) {\n    var all = forecast.toArray();\n}, ...);\n```\n\n>Note: the Array is a clone of the underlying `Forecast` data, however each individual `ForecastEntry` is a mutable instance, so be wary of modifying this data.\n\n###forecast.toString(): Swell data as String \n\n```javascript\n//signature\nforecast.toString([Optional] Object params) : String\n```\n\nTakes an optional parameter hash and returns a string with one line for each forecast entry. \n\n```javascript   \nmsw.forecast(358).then(function (forecast) {\n    console.log(forecast.toString());\n}, ...);\n```\n\nSupports UTC times via:\n\n```javascript\nforecast.toString({ utc: true });\n```\n\nSupports HTML table output via:\n\n```javascript\nforecast.toString({ html: true });\n```\n\nAllows custom date formatting via:\n\n```javascript\nforecast.toString({ dateFormat: 'ddd MMM D HH:mm' }); //eg. Mon Dec 22 21:00\n```\n\n>Uses [moment.js date formatting](http://momentjs.com/docs/#/displaying/format/)\n\n\nSupports modification of entry output via:\n\n```javascript\n//signature\nforecast.toString({ \n    shouldHighlightEntry: function (ForecastEntry entry):Boolean,\n    highlightEntry: function (String entryStr, ForecastEntry entr):String    \n})\n```\n\n>Requires both `shouldHighlightEntry()` and `highlightEntry()` to be supplied. The former returns `true` or `false` as to whether of not to call the output modifier. The modifier `highlightEntry()` is called to transform the output for that entry if required. \n\nReturns swell data in the following format (when `html` is not `true`):\n\n```\nDec 13 01:00  ★       3-4ft (4.5ft 9s ENE)  12mph E     1F\nDec 13 04:00  ★       3-4ft (4.5ft 9s ENE)  12mph E     1F\nDec 13 07:00  ★       3-4ft (4.5ft 9s ENE)  12mph ENE   1F\nDec 13 10:00  ★ ★     3-4ft (5ft 9s ENE)    15mph ENE   1F\nDec 13 13:00  ★ ☆     3-4ft (5ft 9s ENE)    16mph E     10F\nDec 13 16:00  ★ ☆     3-4ft (5ft 9s ENE)    16mph E     10F\nDec 13 19:00  ★ ★     3-4ft (5ft 9s ENE)    14mph E     10F\nDec 13 22:00  ★       3-4ft (5ft 9s ENE)    13mph E     10F\nDec 14 01:00  ☆       2-4ft (5ft 8s ENE)    15mph E     1F\nDec 14 04:00  ★       2-4ft (5ft 8s ENE)    15mph ENE   1F\nDec 14 07:00  ★       2-4ft (5ft 8s ENE)    14mph E     1F\nDec 14 10:00  ★       2-4ft (5ft 8s ENE)    13mph E     1F\nDec 14 13:00  ★       2-4ft (5ft 8s ENE)    12mph E     10F\nDec 14 16:00  ★       2-4ft (5ft 8s ENE)    12mph E     10F\nDec 14 19:00  ★       2-4ft (5ft 8s ENE)    10mph E     11F\nDec 14 22:00  ★       2-4ft (5ft 8s ENE)    12mph E     11F\n```\n\n###forecast.where(): Query forecast data\n\n```javascript\n//signature\nforecast.where(Object params) : Forecast\n```\n\n####Supported Parameters\n\nCan use any combination of the following for:\n\n* __Breaking height__ (the height of the swell in units): `minBreakingHeight` &/or `maxBreakingHeight` \n* __Solid stars__ (MSW assigned solid stars): `minSolidStars` &/or `maxSolidStars`\n* __Faded stars__ (MSW assigned faded stars): `minFadedStars` &/or `maxFadedStars`\n* __Swell period__: (the number of seconds of the primary swell period): `minPeriod` &/or `maxPeriod`\n* __Wind speed__: (the direction of wind in units): `minWindSpeed` &/or `maxWindSpeed`\n* __Wind direction__ (the direction of the wind represented as degrees in the range 0° to 360°): `lowerWindDirection` AND `upperWindDirection`. __Both parameters are required to query on wind direction__.\n* __Datetime__: (the datetime of the forecast relative to the zone's timezone) `minDateTime` &/or `maxDateTime`\n* __Sequence__: (the number of consecutive entries that must occur in order for the entry to be returned) `minSequence`\n\n>Refer to [MSW Guide](http://magicseaweed.com/developer/forecast-api) for Solid & Faded star definitions\n\n>All queries are inclusive. E.g. `minBreakingHeight` of 3 matches all entries `>=` 3\n\n```javascript\n//get all forecast entries with minBreakingHeight at least 3 units\nforecast.where({ minBreakingHeight: 3 });\n\n//get all forecast entries with breaking height between 3 and 8, a wind speed of no more than 10 units and a period of at least 10s\nforecast.where({ minBreakingHeight: 3, maxBreakingHeight: 8, maxWindSpeed: 10, minPeriod: 10 });\n\n//get all forecast entries with at least 3 solid and 1 faded stars\nforecast.where({ minSolidStars: 3, minFadedStars: 1 });\n\n//get all forecast entries with 5 or more solid stars, at least 6 in min breaking height and a 16 or more second period\nforecast.where({ minSolidStars: 5, minBreakingHeight: 6, minPeriod: 16 });\n\n//get all forecast entries with at least 17s period and wind no greater than 10 (mph) which occur in a sequence of at least three entries in length \nforecast.where({ minPeriod: 17, maxWindSpeed: 10, minSequence: 3 });\n```","maintainers":[{"name":"justinjmoses","email":"justinjmoses@gmail.com"}],"time":{"modified":"2022-06-20T12:29:16.662Z","created":"2013-12-16T15:03:29.786Z","0.0.2":"2013-12-16T15:03:49.610Z","0.0.3":"2013-12-16T15:04:43.188Z","0.0.4":"2013-12-17T15:59:18.335Z","0.0.5":"2013-12-17T16:15:03.212Z","0.0.6":"2013-12-18T03:01:26.944Z","0.0.7":"2013-12-19T23:20:14.175Z","0.0.8":"2013-12-23T16:16:59.018Z","0.0.9":"2014-01-15T12:46:42.015Z","0.10.0":"2014-01-15T13:14:43.337Z","0.0.10":"2014-01-15T13:16:55.406Z","0.0.11":"2014-01-15T14:26:02.668Z","0.0.12":"2014-01-15T16:14:09.961Z","0.1.0":"2015-10-29T02:25:17.960Z"},"author":{"name":"justin j. moses"},"repository":{"type":"git","url":"git+https://github.com/justinjmoses/msw-api.git"},"homepage":"https://github.com/justinjmoses/msw-api#readme","keywords":["magicseaweed","msw","msw api"],"bugs":{"url":"https://github.com/justinjmoses/msw-api/issues"},"license":"BSD-2-Clause","readmeFilename":"README.md"}