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

backuparcgis-service

v1.0.2

Published

Async module to backup content from ArcGIS Online hosted feature services.

Downloads

6

Readme

backuparcgis-service

backuparcgis-service to backup content from ArcGIS Online hosted feature services.

About

Hosted Feature Services in ArcGIS Online are a great way to host and serve geospatial data into your online maps. The infrastructure of ArcGIS Online has proven to be performant and highly available. There is, however, always a chance your mission critical services will run into issues. ArcGIS Online outages, accidental deletion, or service corruption can all happen. It's best to be prepared and at least have a backup of your data on hand.

This library, backuparcgis-service, is a performant asynchronous streaming nodejs library that can be imported as a nodejs module or run directly from command line.

Features

Asynchronous

backuparcgis-service is asynchronous and returns a promise when complete.

Versioned

backuparcgis-service only stores a backup of the data if changes has been made. It uses sha256 hashing algorithm to compare new and existing backups. Only services with new data are backed up, saving space.

Streaming

backuparcgis-service streams feature service content directly to a file and does not store it in memory. This allows the script to run faster and avoid memory issues with larger datasets.

Use require()

$ npm install backuparcgis-service
const BackupArcGISService = require('backuparcgis-service')

// new BackupArcGIS(serviceURL, archiveDirectory, ?token)
const Backup = new BackupArcGISService('https://services.arcgis.com/uUvqNMGPm7axC2dD/arcgis/rest/services/state_parks/FeatureServer/0', outDir)

Backup.run().then((resp) => {
    if(!resp.duplicate) {
        console.log(`${resp.serviceDetails.name} completed: ${resp.filename}`)
    } else {
        console.log(`No updates to ${resp.serviceDetails.name}.`)
    }
})

Run from command line

$ npm install backuparcgis-service --global

Format:

backuparcgis-service serviceUrl archiveDirectory

#!/bin/bash

backuparcgis-service https://services.arcgis.com/uUvqNMGPm7axC2dD/arcgis/rest/services/state_parks/FeatureServer/0 ./terminal
backuparcgis-service https://services.arcgis.com/uUvqNMGPm7axC2dD/ArcGIS/rest/services/Brookings_Sites/FeatureServer/0 ./terminal

Response

The library will respond with a promise with the following object:

{
    "duplicate": "boolean",
    "serviceDetails": "object",
    "filename": "string"
}

File Storage Format

A new archive directory will be created in your specified output directory. Within the archive directory, a new folder will be created for each feature service, which is named the same as the item id in ArcGIS Online. Data will be versioned by timestamp, only storing new datasets that are different from the previous export (sha256 hash comparisons).

archive  
└───arcgis_item_id
    │--timestamp.geojson
    │--timestamp.geojson