0.1.2 • Published 7 years ago
@danielhuisman/takeaway v0.1.2
Node.js Takeaway.com API
Unofficial JavaScript implementation of the Takeaway.com API.
Installation
yarn add @danielhuisman/takeaway
Endpoints
- Banks
- CheckVoucher
- Config
- CreateAccount
- Discount
- GeoLocation
- HistoryDetails
- LoyaltyPoints
- ImportOrder
- Menucard
- OnlinePaymentStatus
- Order
- OrderWithOnlinePayment
- RecurringPayment
- ResetPassword
- RestaurantData
- RestaurantList
- Reviews
- ServerTime
- UserAddressList
- UserLoginRequest
- UserOrderHistory
- VietnamDeliveryArea
Usage
import {inspect} from 'util';
import {TakeawayConfig, TakeawayClient} from '@danielhuisman/takeaway';
(async () => {
try {
// Initialize configuration
// See `src/config.js` for defaults
const config = new TakeawayConfig({
language: 'nl',
url: 'https://nl.citymeal.com/android/android.php'
});
// Initialize client
const client = new TakeawayClient(config);
// Request language configurations
let data = await client.getConfig();
console.log(inspect(data, false, null));
// Request restaurants list for area
data = await client.getRestaurants({
postalCode: '7500',
country: '1',
latitude: '52.0000000',
longitude: '6.0000000',
language: 'nl'
});
console.log(inspect(data, false, null));
} catch (err) {
console.error(err);
}
})();
Development
Setup
# Clone Git repository
git clone git@github.com:TakeawayAPI/node-takeaway.git
cd node-takeaway
# Install dependencies
yarn