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

trip-planner

v1.1.1

Published

Embedded trip planner

Downloads

2

Readme

NPM version Build Status

Furkot Trip Planner Widget

Embed Furkot trip planner widget on your website and give your visitors easy way to add your places to their trips.

Installation

Install with npm:

$ npm install --save trip-planner

Install with component:

$ component install furkot/trip-planner

Load with a standalone script:

<script src="https://cdn.furkot.com/scripts/furkot-trip-planner.min.js" defer></script>

API

Furkot trip planner widget displays trip itineraries and supports adding places from any website.

The guide to integration options is here.

initialization

When used with a module bundling framework like browserify and component:

var furkotTripPlanner = require('trip-planner');

When loaded as a standalone, the script instantiates the global variable furkotTripPlaner.

auto discovery

If elements executing HTTP GET or POST to Furkot (anchors or forms linking to https://trips.furkot.com/trip) or elements annotated with microdata exist on a page when its document is ready, they will be automatically discovered and modified to activate Furkot trip planner widget upon click instead of redirecting to Furkot.

When loaded as a stanalone script, nothing further needs to be done. In case of a bundling framework, just invoking require is sufficient to perform the auto discovery.

dynamically added elements

If more elements are added dynamically to the page, they can be discovered and modified to activate Furkot trip planner widget upon click by triggering the discovery process:

var container = ... // container with elements to activate the widget on click

furkotTripPlanner(container);

The container is a single DOM element that contains dynamically added elements. It can be the document to process the entire page. The elements that are already discovered and modified are ignored.

activate widget programmatically

Instead of using DOM elements to pass parameters, it is possible to activate Furkot trip planner widget programmatically by invoking the .plan(stops) method passing stops to be added to visitor's trip. stops is an Array of objects with name, description, coordinates (lat, lon), address, url and duration (in milliseconds). Only name and coordinates (or address in absence of coordinates) are required.

var planner = furkotTripPlanner();

var stops = [{
  name: 'Time Square',
  coordinates: {
    lat: 40.7577,
    lon: -73.9857
  }
}, {
  name: 'Metropolitan Museum',
  coordinates: {
    lat: 40.7789,
    lon: -73.9637
  }
}];

planner.plan(stops);

See how it works with Nooreq.

License

The MIT License (MIT)

Copyright (c) 2014

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.