Socket
Book a DemoInstallSign in
Socket

autoindex

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

autoindex

parse an autoindex page into JSON

0.1.2
latest
Source
npmnpm
Version published
Weekly downloads
22
15.79%
Maintainers
1
Weekly downloads
 
Created
Source

autoindex

parse an autoindex page into JSON (client or server-side)

Ever wanted to take an autoindex page use that data programmatically? Now you can.

example:

autoindex('http://i.johnweis.com/gifs/', function(err, results) {
    console.log(results);
})

output:

root false
parent { href: '/',
  url: 'http://i.johnweis.com//',
  name: 'Parent Directory',
  type: 'dir' }
directories [ { href: 'sample/',
    url: 'http://i.johnweis.com/sample/',
    name: 'sample/',
    type: 'dir',
    modified: Thu Jan 09 2014 22:24:00 GMT-0500 (EST) } ]
files [ { href: 'balance.gif',
    url: 'http://i.johnweis.com/gifs/balance.gif',
    name: 'balance.gif',
    type: 'img',
    modified: Thu Jan 09 2014 22:17:00 GMT-0500 (EST),
    size: '1.0M' },
  { href: 'lemon.gif',
    url: 'http://i.johnweis.com/gifs/lemon.gif',
    name: 'lemon.gif',
    type: 'img',
    modified: Thu Jan 09 2014 22:16:00 GMT-0500 (EST),
    size: '1.1M' },
  { href: 'yes.gif',
    url: 'http://i.johnweis.com/gifs/yes.gif',
    name: 'yes.gif',
    type: 'img',
    modified: Thu Jan 09 2014 22:16:00 GMT-0500 (EST),
    size: '473K' } ]

server-side

npm install autoindex then:

var autoindex = require('autoindex');

client-side

autoindex works with or without jQuery. If you need legacy browser support, make sure to add jQuery to your page. To use autoindex, simply add it to your page via a <script> tag or use RequireJS.

NOTE: If you wish to use this in the browser, enable CORS on that site.

do no evil

If you're going to use this to write webcrawlers, rate-limit yourself.

Keywords

autoindex

FAQs

Package last updated on 10 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.