Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
is expressed by indentation with spaces
grandpa
parent
child
sibling
uncle
two or more spaces mark the end of a dictionary key, therefore ...
keys and list items can have single spaces in them but ...
only dictionary values can contain consecutive spaces:
key 1 value 1
key 2 value 2 contains spaces
if trimming your strings is not an option, you can escape:
a | leading spaces
b trailing spaces |
c | leading and trailing spaces |
pipe symbol |||
empty string ||
keys must be escaped from both ends:
| s pace | key keeps spaces
| | key consists of spaces
|| key is empty string
key ...
value is
a text with
line breaks
which stops
now
...
# comments start with the hash sign
# mixing of data and comments is not allowed
therefore:
1 # this is not a comment
| # neither is this one
# but this one is
this is
an object
the above as json: {"this is": null, "an": "object"}
while
this is
not an object
is equivalent to ["this is", "not an object"]
are expressed like this:
.
a 1
.
b 2
the above as json: [{"a": 1}, {"b": 2}]
key . a .. b . c
is equivalent to
key
a
b
c
:: represents a line break
no spaces in keys allowed, therefore ...
no two-space-seperation necessary:
key . a :: b . c :: d 1 :: e 2
is equivalent to
key
a
b
c
d 1
e 2
noon = require 'noon'
# usage is similar to JSON
noon.stringify { hello: 'world' }
# hello world
noon.parse """
hello world
what's up? ☺
"""
# { hello: 'world', 'what\'s up?': '☺' }
stringify_options = # stringify's second argument, defaults are:
ext: '.noon' # output format: .noon .json .yaml .cson .plist
indent: 4 # number of spaces per indent level
align: true # vertically align object values
maxalign: 32 # maximal number of spaces when aligning
sort: false # sort object keys alphabetically
circular: false # check for circular references (expensive!)
colors: false # colorize output with ansi colors
# custom dictionary or true for default colors:
defaultColors =
url: colors.yellow
key: colors.gray
null: colors.blue
true: colors.blue.bold
false: colors.gray.dim
path: colors.green
value: colors.white
string: colors.white.bold
semver: colors.red
number: colors.magenta
visited: colors.red
# load data from file
data = noon.load 'file.noon'
# or any of the other types in noon.extnames:
data = noon.load 'file.json'
data = noon.load 'file.yaml'
data = noon.load 'file.cson'
data = noon.load 'file.plist'
# write data to file
noon.save 'file.noon', data
# or
noon.save 'file.noon', data, stringify_options
noon.save 'file.json', data # < write as json
noon.save 'filenoext', data, ext: '.noon'
Don't use it if you can't live with the limitations mentioned above.
Don't expect your data to convert flawlessly!
FAQs
no ordinary object notation
The npm package noon receives a total of 7 weekly downloads. As such, noon popularity was classified as not popular.
We found that noon 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.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.