library for the NeoCities.org API

Kyle Drake 2c2fb0e7c3 0.0.2 8 years ago
README.md 33a422411a refactor a bit, add delete and info calls 8 years ago
index.js 33a422411a refactor a bit, add delete and info calls 8 years ago
package.json baf5becade 0.0.2 8 years ago

README.md

NeoCities Node.js Client Library

A node.js library for interacting with the NeoCities api.

Installation

  $ npm install neocities --global

Usage

Uploading files

var NeoCities = require('neocities')
var api = new NeoCities('YOURUSERNAME', 'YOURPASSWORD')

// local file is index.js, saved on site as derp.js

api.upload([
  {name: 'derp.js', path: './index.js'}
], function(resp) {
  console.log(resp)
})

Deleting files

var NeoCities = require('neocities')
var api = new NeoCities('YOURUSERNAME', 'YOURPASSWORD')

api.delete(['derp.js'], function(resp) {
  console.log(resp)
})

Get site info (hits, et cetera)

api.info(function(resp) {
  console.log(resp)
})
api.info('youpi', function(resp) {
  console.log(resp)
})