ain't no thing
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
John SJ Anderson 57700566a5 Better test description 2 days ago
config add app.jawn.basePath [#18] 2 weeks ago
lib Add `.history()` method to lib/jawn [#23] 2 days ago
routes Add some whitespace for readability 2 days ago
test Better test description 2 days ago
views Last working bits of OAuth stuff 1 month ago
.editorconfig Initial commit 2 months ago
.gitignore Add logging framework [#12] 1 month ago
.npmrc Initial commit 2 months ago
.nvmrc upgrade to 12.17 1 month ago
LICENSE Initial commit 2 months ago
README.md some notes in README 3 weeks ago
app.js Make eslint happy 1 week ago
package-lock.json Install `diff2html` 3 days ago
package.json Install `diff2html` 3 days ago

README.md

jawn

ain’t no thing

notes on jawn data structure

so, you’re gonna have a single-level directory, with some number of files. each file has a name and some content. the order of files needs to be preserved, such that the data returned when you read a jawn has the files in the same order as when the jawn was created.

the big question: does the metadata drive everything or does the file layout on disk drive what’s in the metadata?

maybe the metadata file covers things like the jawn name and the file order and the file layout on disk powers the rest of the metadata?

lib/jawn.js library pseudocode/documentation

const jawn = new Jawn(path)

if (!path.exists) {
  mkdir path
}

set up object

jawn.delete()

rmdir(self.path)

reset object back to null

{metadata} = jawn._getMetadata();

get metafile name
metadata = readFile(metafileName);

[{name,data},{name,data}] = jawn.read();

jawn.update([{name,data}, {name,data}, ...]);

metafileName = get metafile name
metadata = <empty metadata struct>
foreach (fileStruct of files) {
  if (fileStruct.name === metafileName) {
    metafileName = get new metafile name
  }
  this.meta.files.push(fileStruct.name)
  fs.write(fileStruct.name, fileStruct.data)
}
writeMeta(metafileName, metadata)