npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

eurostar-booking-magnet

v2.1.3

Published

Component that displays the booking magnet for Eurostar transactions

Downloads

17

Readme

Eurostar Booking Magnet

Component that displays the booking magnet for Eurostar transactions

Before installation

It is presumed that you have jspm and npm installed on your machine globally and within your project.

You must also install plugin-sass installed to ensure sass imports work. You can install by running the following command:

$ jspm install scss=sass

Installation

Base Styles must be installed in order to use the component. For more detailed explaination please review the Styleguide README here

The Booking Magnet has 2 third party libraries which are preinstalled with Base Styles and 3 Eurostar components as dependencies.

Third party dependencies:

  • breakpoint-sass
  • susy

Eurostar dependencies:

  • eurostar-datepicker
  • eurostar-location-select
  • eurostar-traveller-select

Usage

  1. Install modules - note, the Booking Magnet has 3 dependencies: Datepicker, Location Select and Traveller Select. The command below will install them all:

    $ jspm install npm:eurostar-booking-magnet && jspm install npm:eurostar-datepicker && jspm install npm:eurostar-traveller-select
  2. If the component has styles (scss), you can import into main scss file as below.

    @import "jspm:eurostar-booking-magnet/booking-magnet";
    @import "jspm:eurostar-traveller-select/traveller-select";
    @import "jspm:eurostar-datepicker/datepicker";
    @import "jspm:eurostar-location-select/location-select";

    Note the naming convention: jspm:<pkg-name>/<pkg-scss-file>;

  3. If the component contains a Javascript, it should be imported into the the main Javascript file that jspm will be packaging (refer to http://jspm.io/docs/getting-started.html for bundling packages. However, this should be written in a task, e.g. using gulp).

    import BookingMagnet from 'eurostar-booking-magnet';
    import TravellerSelect from 'eurostar-traveller-select';
    import Datepicker from 'eurostar-datepicker';
    import LocationSelect from 'eurostar-location-select';
    
    const locationSelect = new LocationSelect();

    This imports the BookingMagnet class from the booking-magnet.js file. The TravellerSelect and Datepicker are also imported for DI. Note how the Location Select is initialised outside of the Booking Magnet

  4. To initialise the BookingMagnet, use the following code:

    const options = {};
    options.TravellerSelect = TravellerSelect;
    options.Datepicker = Datepicker;
    
    const bookingMagnet = new BookingMagnet(options);