Socket
Socket
Sign inDemoInstall

remote-save

Package Overview
Dependencies
3
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    remote-save

Simple save javascript object from remote host (e.g. browser) to json on file system


Version published
Weekly downloads
6
increased by50%
Maintainers
1
Install size
51.1 kB
Created
Weekly downloads
 

Readme

Source

remote-save

Simple save javascript object from remote host (e.g. browser) to json on file system NB! Only for develop uses. Not for production.

npm install --save-dev remote-save

Example


// on server-side

const path = require('path')
const express = require('express')
const remoteSave = require('remote-save').server

const app = express()

const folder = path.join(__dirname, 'remote-save-folder')
app.use('/remote-save', remoteSave({ folder, extend: false }))


// on remote-side (e.g. browser)

import client from 'remote-save/lib/client'

const saver = client({ url: '/remote-save' }) // or full if other host

saver('file-name', {
  a: true,
  b: [1, 2, 3],
})

As a result json file file-name.json will be saved in remote-save-folder

{
  "a": true,
  "b": [
    1,
    2,
    3
  ]
}

NB! Result file will be deep extended, if extend: true options is specified

Keywords

FAQs

Last updated on 29 Oct 2017

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc