
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
org-mode-connection
Advanced tools
#+TITLE: org-mode-connection
This package allows to read, write and sync emacs's org-mode files.
It was developed as foundation for [[https://github.com/bnankiewicz/organic][organic]] - mobile org-mode client written in React Native.
It is designed to work both in mobile and server/desktop environments.
#+BEGIN_SRC sh yarn add realm promisify-node org-mode-connection #+END_SRC
** with Node.js
#+name: setup #+BEGIN_SRC js :results output var OrgApi = require('org-mode-connection').OrgApi const realm = require('realm') const promisify = require('promisify-node'); const fsInterface = promisify('fs')
OrgApi.configureFileAccess(fsInterface); OrgApi.configureDb(realm); OrgApi.connectDb(); #+END_SRC
** with React Native #+BEGIN_SRC javascript import OrgApi from 'org-mode-connection'; import RNFS from 'react-native-fs'; import Realm from 'realm';
OrgApi.configureFileAccess(RNFS); OrgApi.configureDb(Realm); OrgApi.connectDb(); #+END_SRC
** Example
#+BEGIN_SRC js :results output :noweb yes const query = async() => { await OrgApi.clearDb() await OrgApi.addFile('~/org/organizer.org') const res = await OrgApi.getAllFilesAsPlainObject() console.log(res) } query() #+END_SRC
** Parsing node content #+name: parse-example-content #+BEGIN_SRC js :results output code :noweb yes //import { NodeContentParser } from "org-mode-connection"; const NodeContentParser = require('org-mode-connection').NodeContentParser const res = NodeContentParser(" this is bold and this /italic/\nnext line"); console.log("// Parsed lines:\n", res, "\n") console.log("// Content of the first line:\n", res[0].content) #+END_SRC
#+BEGIN_SRC js // Parsed lines: [ { type: 'regularLine', content: [ [Object], [Object], [Object], [Object], [Object] ] }, { type: 'regularLine', content: [ [Object] ] } ]
// Content of the first line: [ { content: ' ', type: 'regularText', indexStart: 0, indexEnd: 1 }, { type: 'boldText', indexStart: 1, indexEnd: 15, content: 'this is bold' }, { content: ' and this ', type: 'regularText', indexStart: 15, indexEnd: 25 }, { type: 'italicText', indexStart: 25, indexEnd: 33, content: 'italic' }, { content: '', type: 'regularText', indexStart: 33, indexEnd: undefined } ] #+END_SRC
=Arguments=:
=Results=:
Promise
** addNodes(/nodes/, /insertPosition/, /externalChange/, /returnAddedNodes/) Add nodes to the tree of nodes
=Arguments=:
=Results=:
Promise<[[#PlainOrgNode][PlainOrgNode]][]>
** clearDb() Clears Database.
=Results=:
Promise
** configureDb(/realm/) Configure database.
=Arguments=:
=Results=:
void
** configureFileAccess(/fsIterface/) =Arguments=:
=Results=:
void
** connectDb() Connect database
=Results=:
Promise
** createFileFromString(/name/, /lines/) Create file from array of strings.
=Arguments=:
=Results=:
Promise
** deleteFileById(/fileId/) Delete file from database.
=Arguments=:
=Results=:
Promise
** deleteNodeById(/nodeId/) Deletes node.
=Arguments=:
=Results=:
Promise
** getAgendaAsPlainObject(/timeRange/, /defaultWarningPeriod/) Returns agenda as plain object
=Arguments=:
=Results=:
Promise<[[#PlainAgenda][PlainAgenda]]>
** getAllFilesAsPlainObject() Returns all OrgFiles as plain objects
=Results=:
[[#PlainOrgFile][PlainOrgFile]][]
** getAncestorsAsPlainObject(/nodeId/) Returns all ancestors of node.
=Arguments=:
=Results=:
Promise<[[#PlainOrgNode][PlainOrgNode]][]>
** getExternallyChangedFiles() Returns ids of externally changed files
=Results=:
Promise<[[#ExternalFileChange][ExternalFileChange]][]>
** getFileAsPlainObject(/id/) Returns file and its nodes data as plain object.
=Arguments=:
=Results=:
Promise<[[#PlainOrgFile][PlainOrgFile]]>
** getObjects(/model/, /filter/) Return raw RealmResults object
=Arguments=:
=Results=:
Promise<[[#RealmResults][RealmResults]]>
** getOrCreateNodeByHeadline(/targedNode/) Gets node by headline. If node doasnt exists it is created.
=Arguments=:
=Results=:
Promise<[[#PlainOrgNode][PlainOrgNode]]>
** getRelatedNodes(/nodeId/) Returns ancestors and descendants
=Arguments=:
=Results=:
Promise<[[#PlainOrgNode][PlainOrgNode]][]>
** getTagsAsPlainObject() Returns list of all tags
=Results=:
Promise<string[]>
** getTocs() Returns all files with their child nodes
=Results=:
Promise<[[#Tocs][Tocs]]>
** importFile(/filepath/) Imports external file
=Arguments=:
=Results=:
Promise
** search(/searchQuery/) Search
=Arguments=:
=Results=:
Promise
** syncDb() Sync all files
=Results=:
Promise
** syncFile(/id/) Syncs file
=Arguments=:
=Results=:
Promise
** updateFile(/id/, /changes/) Merges prop to file object
=Arguments=:
=Results=:
Promise
** updateNodeById(/id/, /changes/) Merges props to node object
=Arguments=:
=Results=:
Promise
** PlainOrgFile :PROPERTIES: :CUSTOM_ID: PlainOrgFile :END: #+BEGIN_SRC typescript type PlainOrgFile = { id: string; name: string; size: string; ctime: string; mtime: string; path: string; title: string; description: string; metadata: string; category: string; lastSync: string; isChanged: boolean; isConflicted: boolean; }; #+END_SRC
** PlainOrgNode :PROPERTIES: :CUSTOM_ID: PlainOrgNode :END: #+BEGIN_SRC typescript type PlainOrgNode = { id: string; level: number; position: number; headline: string; content?: string; fileId: string; category?: string; todo?: string; priority?: string; drawers: string; tags: string[] timestamps: PlainOrgTimestamp[] } #+END_SRC
** PlainOrgTimestamp :PROPERTIES: :CUSTOM_ID: PlainOrgTimestamp :END: #+BEGIN_SRC typescript type PlainOrgTimestamp = { type: "active" | "inActive" | "scheduled" | "deadline"; date: string; dateRangeEnd: string; dateRangeWithTime: boolean; dateWithTime: boolean; warningPeriod: string; repeater: string; } #+END_SRC
** PlainAgenda :PROPERTIES: :CUSTOM_ID: PlainAgenda :END: #+BEGIN_SRC typescript type NodeTimestamp = { type: string; nodeId: string; }
type PlainAgenda = { nodes: PlainOrgNodesDict; agendaItems: NodeTimestamp[]; dayAgendaItems: NodeTimestamp[]; }; #+END_SRC
** SearchQuery :PROPERTIES: :CUSTOM_ID: SearchQuery :END: #+BEGIN_SRC typescript type SearchQuery = { searchTerm: string; todos: any[]; tags: any[]; priorioty: string; isScheduled: boolean; hasDeadline: boolean; }; #+END_SRC
** FsInterface :PROPERTIES: :CUSTOM_ID: FsInterface :END: #+BEGIN_SRC typescript type FsStat = { mtime: string; ctime: string; name: string; size: string; }
interface FsInterface { write(): Promise; exists(path: string): Promise; read(path: string): Promise<string[]>; stat(path: string): Promise; } #+END_SRC ** ExternalFileChange :PROPERTIES: :CUSTOM_ID: ExternalFileChange :END: #+BEGIN_SRC typescript type ExternalFileChange = { id: string; mtime: string; }; #+END_SRC
** InsertPosition :PROPERTIES: :CUSTOM_ID: InsertPosition :END: #+BEGIN_SRC typescript type InsertPosition = { fileId: string; nodeId?: string; headline?: string; } #+END_SRC
** TimeRange :PROPERTIES: :CUSTOM_ID: TimeRange :END: #+BEGIN_SRC typescript type TimeRange = { start: string; end: string; }; #+END_SRC
** Tocs :PROPERTIES: :CUSTOM_ID: Tocs :END: #+BEGIN_SRC typescript type Tocs = { ids: { [fileId: string]: string[] }; data: PlainOrgNodesDict; }; #+END_SRC
** PlainOrgNodesDict #+BEGIN_SRC typescript type PlainOrgNodesDict = { [nodeId: string]: PlainOrgNode }; #+END_SRC
** Realm :PROPERTIES: :CUSTOM_ID: Realm :END: RealmJs object.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
FAQs
Read, write, synchronize and query emacs's org-mode files.
We found that org-mode-connection demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.