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

@digitallinguistics/javascript

v0.5.0

Published

A JavaScript library for working with linguistic data in DLx format

Downloads

26

Readme

DLx JavaScript Library

A JavaScript library for working with linguistic data in DLx format. For browser and Node.

Digital Linguistics (DLx) is the science of the digital data management of linguistic data, of the kind typically produced during language documentation projects. This repository contains a JavaScript library for working with linguistic data in the Data Format for Digital Linguistics (Daffodil). It includes models for various linguistic objects, useful data and constants, and other utilities for working with language data.

npm version npm downloads GitHub issues GitHub test workflow status Zenodo DOI GitHub GitHub stars

View the API documentation for this library.

Maintained by Daniel W. Hieber (University of California, Santa Barbara). Please cite this library using the following model:

Hieber, Daniel W. 2020. @digitallinguistics/javascript. DOI:10.5281/zenodo.597714.

Contents

Getting Help & Contributing

Overview

The DLx JavaScript library has the following exports. See the API documentation for complete details on the contents of this library.

Export | Description -------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- core | Base classes and other code reused across this library. Most users will not need to use this module. models | A collection of objects representing common linguistic objects, such as Language, Lexeme, etc. These have various utility functions attached to them, and ensure that their data is valid according to the DLx Data Format. utilities | Assorted utilities for working with data in DLx format utilities/regexp | Useful regular expressions (e.g. languageTag.js, ISO.js) utilities/types | Type-checking methods (e.g. isLanguageTag.js, isISO.js)

Usage

  1. Install using npm (npm i @digitallinguistics/javascript) or yarn (yarn add @digitallinguistics/javascript), or download the library from the releases page and include the files you need in your project.

  2. In Node, import the library as follows:

import dlx from '@digitallinguistics/javascript';
  1. In HTML, link src/index.js in a script tag:
<script src=dlx/src/index.js type=module></script>
  1. If your project does not support ES modules or recent JavaScript syntax, you may need to bundle and/or transpile this module for use in your code, using libraries like Babel and webpack.

  2. Use the library in your code:

import { models } from '@digitallinguistics/javascript';

const { Lexeme } = models;

const lexeme = new Lexeme({/* lexeme data */})
  1. You can also import standalone submodules and files, rather than the entire library:
import types       from '@digitallinguistics/javascript/types';
import punctuation from '@digitallinguistics/javascript/models/Language.js';
  1. See the API documentation for complete details on using the library.