library for the NeoCities.org API

Kyle Drake d0715c7a97 Merge pull request #6 from ungoldman/patch-1 il y a 7 ans
README.md ed730a4ca6 docs: remove global flag from install section il y a 7 ans
index.js 33a422411a refactor a bit, add delete and info calls il y a 10 ans
package.json 8f64d534b6 chore(package): version dependencies il y a 7 ans

README.md

NeoCities Node.js Client Library

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

Installation

$ npm install neocities

Usage

First, require the library and initialize:

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

Uploading files to your site

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

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

Deleting files from your site

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)
})