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

irctc-api

v3.0.3

Published

An exclusive NodeJs only package built on top of IRCTC Website APIs to book train tickets, managing user profile faster and simpler from anywhere in the world

Downloads

326

Readme

A package built on top of IRCTC Website APIs to book train tickets, managing user profile faster and simpler. Currently this package only works on NodeJs environment and we were not recommending this to use on browser or any other Javascript environment.

Useful Links

Download stats Supported Versions Contributors License Version GitHub Issues or Pull Requests socket.dev GitHub last commit GitHub Actions Workflow Status GitHub Stars NPM Link Github Link Documentation Link Home Page Link

[!NOTE]

This irctc-api script for automating IRCTC ticket booking
is created strictly for educational purposes. The code and its
usage are intended to showcase irctc-api testing capabilities and
best practices. Any attempt to use this script for unauthorized
access or activities that violate IRCTC terms of service or legal
regulations is strictly prohibited. The author(s) and associated
entities are not responsible for any misuse or legal consequences 
resulting from the use of this script for any unauthorized 
activities.

Useful Links

Installing

To install the this package, simply type i or install irctc-api using the node package manager

npm install irctc-api

Prerequisite

This Package uses viu, A rust module uses iterm image protocol for displaying images within System Terminal.

We use that for displaying captcha images on command line for login and bookings as to make your booking flow in a seamless way.

irctc-api automatically installs viu binary based on your os and processor architecture, If we could not find your viu binary related to your processor and os, you are required to install viu through their standard installation.

Then provide viu binary path in params as

{
  "viu":"path/to/binary/viu | path/to/binary/viu.exe"
}

Notes

  • Currently this project is designed to accept only UPI Collect request and IRCTC wallet as payment option and other payment modes are not supported as of now. When the payment request is initiated, The command line will display the payment request details such that you need to complete the payment from your UPI mobile App for UPI payment method.

Import

This Package exports a class named IRCTC which contains three functions.

  • book
  • last_transaction
  • pnr_status
  • master_passengers

Other variables export

  • countries
  • stations

To send a request, you only need to import the IRCTC.

// ES5 example
const { IRCTC } = require("irctc-api");
// ES6+ example
import { IRCTC } from "irctc-api";

Examples

The Code Examples are hosted at Github Repo - suryavaddiraju/irctc-api

Usage

To send a request, you:

  • Initiate IRCTC class
  • Call available function operation on class with input as javascript object.
// a client can be shared by different commands. But it is currently in development untill then use client seperately.
const client = new IRCTC({
  // irctc_class_params
});

const params = {
  // refer https://dev.vaddiraju.in/irctc-api/api_reference#book_input
};
const command = await client.book(params);

Async/await

We recommend using await operator to wait for the promise returned by send operation as follows:

// async/await.
try {
  const data = await client.book(params);
  // process data.
} catch (error) {
  // error handling.
} finally {
  // finally.
}

Async-await is clean, concise, intuitive, easy to debug and has better error handling as compared to using Promise chains or callbacks.

Getting Help

Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.

Contributing

Any modifications will be overwritten the next time the irctc-api package is updated. To contribute to the package you can check our contribution page.

License

This package is distributed under the Apache License, Version 2.0, see LICENSE for more information.

Client Commands (Operations List)

Copyright

All Rights Reserved. © Vaddiraju Surya Teja, 2024