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

trader

v0.1.2

Published

Trader is a command line tool to crawl equity data and to rate equities with arbitrary rating systems.

Downloads

11

Readme

Trader is a command line tool build with node to crawl equity data and to rate equities with arbitrary rating systems.

Installation

$ npm install trader

How to use the CLI tool

$ trader -h

  Usage: trader [options]

  Options:

    -h, --help               output usage information
    -V, --version            output the version number
    -p, --progress           show a progress bar if possible (do not use progress if you want to pipe the output)
    -i, --input <importer>   importer to use to fetch equities [dax]
    -o, --output <format>    choose output format [table]
    -r, --rating <type>      choose rating system [none]

Importers

There are the following importers shipped with trader:

  • dax: Import the 30 DAX equities from Frankfurt Stock Exchange
  • downjones: Import Dow Jones from Frankfurt Stock Exchange
  • index(indexName, stockMarket=FSE): Import all equities of an index
  • jsonfile(filename): Import equities from a JSON file with the same format of the JSON output formatter

Output Formatters

There are the following output formatters shipped with trader:

  • table: Prints a text table (does not contain the full equity data though)
  • json: Output JSON

Rating Systems

There are the following rating systems shipped with trader:

  • orderby(factName, descending=true): Order equities by a fact in the latestFact object.
  • levermann(indexName): Rating system according to Susanne Levermann's book "Der entspannte Weg zum Reichtum"

Data Format

An equity object should contain the following attributes:

{
    isin: The ISIN unique equity id
    wkn: The WKN unique equity id
    name: The name of the equity
    currency: e.g. EUR or USD
    latestPrice: The current price (as realtime as possible)
    monthlyPrices: [...] Array of monthly prices of the first day in each month of the last 12 months starting with the price at the beginning of the current month.
    dailyPrices: [...] Array of daily prices at the beginning of each day in the last 30 trading(!) days starting with the price of the last ended trading day.
    latestFacts: {
        year: The year of the facts
        pbRatio: P/B ratio (german: KBV)
        peRatio: P/E ratio (german: KGV)
        dividendPerShare: (german: Dividende pro Aktie)
        returnOfEquity: (german: Eigenkapitalrendite)
        ebitMargin: (german: EBIT Marge)
        ebitdaMargin: (german: EBITDA Marge)
        equityRatio: (german: Eigenkapitalquote)
        marketCap: (german: Marktkapitalisierung)
        earningsPerShare: (german: Ergebnis je Aktie)
        dynamicPeRatio: (german: Dynamisches KGV)
        cashflowPerShare: (german: Cashflow je Aktie)
        pcfRatio: price / cashflow ratio (german: KCV)
        psRatio: price sales ratio (german: KUV)
        profitGrowth: (german: Gewinnwachstum)
        salesGrowth: (german: Umsatzwachstum)
        dividendYield: (german: Dividendenrendite)
        returnOnSales: (german: Brutto-Umsatzrendite)
        employees: number of employees
        sales: (german: Umsatz)
        cashfowMargin: (german: Cashflow-Marge)
        debtEquityRatio: (german: Verschuldungsgrad)
        dynamicDebtEquityRatio: (german: Dynamischer Verschuldungsgrad)
        cfroi: Cashflow Return-on-Investment
    }
    historicFacts: [{},...] Array containing the same objects as latestFacts but with facts of the last years, latestFacts is not included in this list
}

If some values cannot be retrieved they will be null.

Running Tests

$ grunt simplemocha

License

(The MIT License)

Copyright (c) 2013 Mario Volke <[email protected]>

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.