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

verra

v0.3.8

Published

File.army client.

Downloads

7

Readme

verra

Build Status Coverage Status Dependency Status

File.army client.

Requirements

You need three things:

Node 6

I recommend n-install to install and manage current node versions.

curl -L https://git.io/n-install | bash

This will also install npm, the default node package manager.

file.army

file.army is of course the site that pays you (in bitcoins) to share interesting images.

You will find the author's account at https://file.army/robinmillette, you're encouraged to follow him :-)

bitcoinwallet

bitcoinwallet is required by file.army to get paid (in bitcoins). The provided link uses my account as a reference.

Install

$ npm install --global verra

Don't worry if you see these warnings:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/verra/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

Upgrade

$ npm update --global  verra

Help

Before you can use verra, you need to configure your FILEARMY_TOKEN as specified in the login section below.

Alternately, you can also specify the FILEARMY_TOKEN when launching verra:

$ FILEARMY_TOKEN=[YOUR-PHPSESSID-HERE] verra

Replace [YOUR-PHPSESSID-HERE] with your alphanum key.

$ verra

  File.army client.

  Available commands:
    * This text: help
    * Name and version: version
    * List all categories: categories
    * List all albums: albums
    * Init watch directory: init <dir>
    * Fetch image info: image-json <url or id>
    * Edit image info: image-edit <url or id>
    * Upload new image by URL: url <url>
    * Upload new image by filename: file <filename>
    * Watch a directory for new images to upload: watch <dir>

  Possible flags:
    * --title=<title|STRING>
    * --description=<title|STRING>
    * --category=<category|INTEGER|STRING>
    * --category (disables default category found in .env)
    * --wait=<seconds|INTEGER> (waits between seconds and 1.5 * seconds)
    * --type=<type|STRING> (directory init: "categories" or "albums")
    * --incognito (user-agent imposter and stuff)
    * --incognito=<user-agent|STRING>
    * --incognito=<false|no|0|STRING> to disable if it's set in the environment

Watching a directory

One of the most interesting features of verra is its ability to watch a directory for files to upload.

$ verra watch A-DIRECTORY-WITH-IMAGES

Every file from that directory and subdirectories will be uploaded to file.army using the filename as the image title, waiting 5 to 7 minutes between uploads by default.

A default category will be used if provided, but you can also organize your images in directories according to categories.

$ verra init A-DIRECTORY-WITH-IMAGES --type=categories # create subdirectories
$ verra watch A-DIRECTORY-WITH-IMAGES --type=categories # start watching

Login

You must login manually thru the website.

Bookmarklet

javascript:void(function(){alert('FILEARMY_TOKEN='+document.cookie.split(';').filter((z)=>z.split('=')[0].trim()==='PHPSESSID').map((z)=>z.split('=').slice(1).join('='))[0])}())

Once logged in, run the bookmarklet to obtain your credentials.

What's a bookmarklet you ask? It's just a browser bookmark but instead of a link to a page, it holds a bit of javascript. So create a bookmark (on your toolbar if you can) and simply paste the above line of code for the bookmark location (or URL).

Basically, we alert (with that annoying infobox) the user and display the value of the PHPSESSID cookie. In other words:

javascript:void(
  function () {
    alert('FILEARMY_TOKEN='+
      document.cookie
        .split(';')
        .filter((z)=>z.split('=')[0].trim()==='PHPSESSID')
        .map((z)=>z.split('=').slice(1).join('='))[0]
    )
  }()
)

You could also open a JavaScript console and type:

document.cookie

... and figure out the PHPSESSID value to use. It's all good. Eventually, we hope, verra will support an improved login feature.

Env file

Create a .env file with the following content:

FILEARMY_TOKEN=[Your current PHPSESSID]

You can also provide a default category if that's your thing, as well as other settings:

FILEARMY_TOKEN=[Your current PHPSESSID]
FILEARMY_CATEGORY=[Default category key]
VERRA_WAIT=[Wait time in seconds]
VERRA_INCOGNITO=Yes|True|1 or a User-Agent string
VERRA_WATCH=[Default watch directory]

The entry CATEGORY=[Default category key] is deprecated and replaced by FILEARMY_CATEGORY.

Warning

Don't put your .env file in the directory containing images you are watching.

Now with update-notifier

The cli now uses update-notifier to let the user know about updates to this program.

Users have the ability to opt-out of the update notifier by changing the optOut property to true in ~/.config/configstore/update-notifier-verra.json. The path is available in notifier.config.path.

Users can also opt-out by setting the environment variable NO_UPDATE_NOTIFIER with any value or by using the --no-update-notifier flag on a per run basis.

License

AGPL-v3 © Robin Millette