README
content-entry
content entries for content containers (aka files)
API
Table of Contents
- CollectionEntryMixin
- BaseEntry
- BufferContentEntryMixin
- BufferContentEntry
- ContentEntry
- DeletedContentEntry
- EmptyContentEntry
- ReadableStreamContentEntry
- StreamContentEntryMixin
- StringContentEntryMixin
- StringContentEntry
- toReadableStream
- equalsUint8Arrays
CollectionEntryMixin
Brings directory attributes to entries.
Parameters
superclass
BaseEntry
Representation of one file or directory entry. All names are absolute (no leading '/') the group seperator is '/'.
Parameters
name
string name inside of the container
Properties
name
string name inside of the container
types
Returns Array<string> UTI types
isCollection
Returns boolean false
isBlob
Returns boolean false
mode
Default unix mode for files.
Returns number 0644
isEmpty
Returns boolean true if there is no content (length := 0).
isDeleted
Returns boolean true if we represent a deleted entry
isExistent
Returns boolean true if we exist
equals
Parameters
other
Returns Promise<boolean> true if name, isBlob and isCollection are the same
BufferContentEntryMixin
Content entries where a Buffer is the primary data representation.
Parameters
superclass
Properties
buffer
Buffer
BufferContentEntry
Extends BufferContentEntryMixin(ContentEntry)
ConentEntry with a Buffer as content store.
Parameters
isEmpty
Returns boolean true if buffer length is zero
ContentEntry
Extends BaseEntry
General content access entries.
isBlob
Returns boolean true
types
UTI types for this entry.
readStream
Returns any undefined
string
Returns string
buffer
return {Uint8Array}
encoding
The default encoding used to convert content to strings.
Returns BufferEncoding
equalsContent
Compare content against other entry.
Parameters
other
ContentEntry
Returns Promise<boolean> true if other has the same content (bitwise)
getReadStream
Meta
- deprecated: This is deprecated.
DeletedContentEntry
Extends EmptyContentEntry
Represents a deleted entry.
isDeleted
We are always deleted.
Returns boolean true
isExistent
Nothing there any more.
Returns boolean false
EmptyContentEntry
Extends ContentEntry
Represents a entry without content (content length = 0).
string
Returns string
buffer
Returns Uint8Array zero length buffer
readStream
Returns ReadableStream zero length stream.
ReadableStreamContentEntry
Extends StreamContentEntryMixin(ContentEntry)
Content entries where a readable stream is the primary data representation.
Parameters
name
stringreadStream
ReadableStream
Properties
name
stringreadStream
ReadableStream
StreamContentEntryMixin
Content entries where a stream is the primary data representation.
Parameters
superclass
StringContentEntryMixin
Content entries where a string is the primary data representation.
Parameters
superclass
Properties
string
string
StringContentEntry
Extends StringContentEntryMixin(ContentEntry)
Content entries where a string is the primary data representation.
Parameters
Properties
isEmpty
Returns boolean true if string length is zero
toReadableStream
Parameters
input
string
Returns Readable
equalsUint8Arrays
Returns true if the two passed Uint8Arrays have the same content
Parameters
a
Uint8Arrayb
Uint8Array
Returns boolean true if content of a equals b
install
With npm do:
npm install content-entry
license
BSD-2-Clause