Comments (4)
I've been looking for methods of data persistence. The serialize method provided by atom applies typically to classes, while we need to store a global variable history in our case.
https://www.npmjs.com/package/jsonfile
This package provides a way to read from and write to JSON, but I don't know whether it works with local files, for a browser would forbid cross domain access.
from csc-510-group-g.
Definitely possible to use this. You can write to the file when Atom closes, or even when you copy/cut and then read from it when Atom opens again or initializes.
You might want to take a look at https://nodejs.org/api/fs.html as well. It's what I'm using for the telemetry part so if you take a look at the code I've added to the telemetry, you should have an example on how to implement reading/writing to a file.
from csc-510-group-g.
How'd you implement it would be:
- Add the package to package.json and then run apm install.
- Add
fs = require 'fs'
to the top of the file where you're declaring the external modules/packages being used. - Add the readFile function call to the init method and then populate the clipboard, and call appendFile whenever you copy something so that it's stored in the file. (Alternately there might be a shutdown or close method by Atom, and you could just copy the entire contents of the clipboard when this is called.)
from csc-510-group-g.
Thanks for the suggestion! I have managed to preserve the data with serialize method. Not in a standard way, but it's simple and effective.
from csc-510-group-g.
Related Issues (20)
- Having problem with telemetry and clipit-cmd HOT 13
- Problem with clipit-panel HOT 11
- Meeting Apr. 3
- pyobjc on mac HOT 12
- Data collected from experiments HOT 3
- Presentation Outline HOT 1
- Presentation Notes HOT 1
- Meeting Apr 06
- Repo Management HOT 1
- Report Edits HOT 5
- Presentation Content HOT 9
- Meeting Apr 13 HOT 1
- Meeting Apr 20th HOT 1
- Report Outline HOT 1
- Getting gitable running HOT 10
- R script for graph plot HOT 5
- Draft statistics and tasks to care about on bad smells HOT 3
- Meeting Apr 27th HOT 38
- This is a test issue. HOT 1
- Meeting May 1 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csc-510-group-g.