At some point, I'll think of something clever and/or useful to put here. For now, it's just here to say hello.
And, here's a Mastodon link. The rel="me"
thing is annoying, but I get it.
<a rel="me" href="https://masto.ai/@claylo">:eyeroll:</a>
Valid, modular YAML documents with js-yaml. Seriously.
License: ISC License
// main.yaml
colors: !!inc/file colors.yaml
// colors.yaml
[red, yellow, green]
Currently this returns something that looks like this:
{colors: {0: "red", 1: "yellow", 2: "green"}}
but I would expect to get something like this:
{colors: ["red","yellow","green"]}
This seems like a bug, correct?
naltatis
I have a directory structure like the following (example demonstrating my actual setup):
config/
-- development.yml
-- production.yml
-- databases.yml
-- assetHosts.yml
tests/
-- test.js
and I want to assign the objects loaded from databases.yml
and assetHosts.yml
to top-level keys in each of development.yml
and production.yml
like so:
databases: !! inc/file development.yml
assetHosts: !! inc/file assetHosts.yml
Then I load these files in both webpack from the root of the project, and running unit tests from the tests
directory (ie. cd tests && mocha **/*.test.js
).
It would find the files located in its own directory and parse them.
Webpack reports a file not found error trying to load databases.yml
. So I change the directory to be relative to where I'm running webpack from (ie. inc/file config/databases.yml
). This works for webpack, but then mocha reports an error when running tests because it can't find config/databases.yml
.
Since lib/file.js
uses process.cwd()
as its base, the actual path to the file is dependent on how I run js-yaml
. This results in the path behavior being very unpredictable.
Consider this file structure:
# in include1.yml
props:
- &key
key: value
# in main.yml
name: main
include1: !!inc/file include1.yml
properties:
- *key
It will throw a YAMLException with: unidentified alias "key"
, because the key isn't even included.
Front matter is a special markdown format that eventually is parsed as a JSON or YAML (e.g., https://github.com/jxson/front-matter or https://www.npmjs.com/package/gray-matter). So, it would be cool to have an ability to specify function to use that parses including files, by default it can be yaml.load
What do you think?
debug is inside devDependencies, but require('debug')
in lib/dir.js and lib/file.js.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.