Socket
Socket
Sign inDemoInstall

@editorialapp/datatools

Package Overview
Dependencies
19
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @editorialapp/datatools

A collection of dependencies organized into useful tools for working with data in ways that are common in data cleaning and in building news apps.


Version published
Weekly downloads
596
decreased by-36.53%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@editorialapp/datatools

A collection of dependencies organized into useful tools for working with data in ways that are common in data cleaning and in building news apps.

These tools assume they will be used as part of scripts run with Node.js.

Turn a directory of markdown into a sqlite3 table

An example taken from the tests:

import { markdownDirectoryToTable } from '@editorialapp/datatools'
import * as dirname from 'desm'

const markdownDirectory = dirname.join(import.meta.url, './fixtures/markdown')

// an instance of Database from better-sqlite3 is returned
const db = await markdownDirectoryToTable({
	directoryFilepath: markdownDirectory,
	tableName: 'markdown',
	columns: {
		title: 'TEXT',
		content: 'TEXT'
	}
})

const rows = await db.prepare('SELECT * FROM markdown;').all()

console.log(rows)
// returns:
// [
// 	{ title: 'B', content: '<p>This is b.</p>\n' },
// 	{ title: 'C', content: '<p>This is c.</p>\n' },
// 	{ title: 'A', content: '<p>This is a.</p>\n' }
// ]

License

Apache-2.0

Keywords

FAQs

Last updated on 17 Feb 2024

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